-
Notifications
You must be signed in to change notification settings - Fork 242
/
open-logic-config.sty
1590 lines (1091 loc) · 46.2 KB
/
open-logic-config.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% % The Default OLP Configuration File `open-logic-config.sty`
% % Open Logic Project
%
% Description
% ===========
%
% This file contains all commands and environments that are meant to
% be configured, changed, or adapted by a user generating their own
% text based on OLP text. **Do not edit this file to customize your
% OLP-derived text!** A file `myversion.tex` adapted from
% `open-logic-complete.tex` (or from any of the contributed example
% master files) will include `myversion-config.sty` if it exists. It
% will do so after it loads this file, so your `myversion-config.sty`
% will redefine the defaults. This means you won't have to include
% everything, e.g., you can just change some tags and nothing else. You
% may copy and paste definitions you want to change into that file, or
% copy thi file, rename it `myversion-config.sty` and delete anything
% you'd like to leave as the default.
\NeedsTeXFormat{LaTeX2e}
% Symbols
% =======
% Formula metavariabes
% --------------------
%
% Use the exclamation point symbol `!` immediately in front of an
% uppercase letter in math mode for formula metavariables. By
% default, `!A`, `!B`, ... are typeset as $\varphi$, $\psi$, $\chi$,
% ... if you use the command `\olgreekformulas`. If this is not desired,
% and you'd like $A$, $B$, $C$, ... instead, use `\ollatinformulas`.
% If you issue `\olalphagreekformulas`, you'll get $\alpha$, $\beta$,
% $\gamma$, \dots.
\olgreekformulas
% Greek symbols: prefer varphi and varepsilon
\let\oldphi\phi
\let\phi\varphi
\let\oldepsilon\epsilon
\let\epsilon\varepsilon
% Logical symbols
% ---------------
% The following commands are used in the OLP texts for logical
% symbols. Their definitions can be customized to produce different
% output.
% ### Truth Values
%
% - `\True` defaults to $\mathbb{T}$ and `\False` to $\mathbb{F}$.
\DeclareDocumentMacro \True {\ensuremath{\mathbb{T}}}
\DeclareDocumentMacro \False {\ensuremath{\mathbb{F}}}
% Other truth values
\DeclareDocumentMacro \Indet {\ensuremath{\mathbb{I}}}
\DeclareDocumentMacro \Undef {\ensuremath{\mathbb{U}}}
% ### Propositional Constants and Connectives
%
% - Falsity is `\lfalse` and defaults to $\bot$.
\DeclareDocumentMacro \lfalse {\bot}
% - Truth is `\ltrue` and defaults to $\top$.
\DeclareDocumentMacro \ltrue {\top}
% - Negation is `\lnot` and defaults to $\lnot$. To use a different
% symbol (e.g., tilde), use the following line.
% `\DeclareDocumentMacro \lnot {\mathord{\sim}}`
% - Conjunction is `\land` and deaults to $\land$. to use ampersand,
% uncomment the following line
% `\DeclareDocumentMacro \land {\mathbin{\&}}`
% - Disjunction is `\lor` and defaults to $\lor$.
% - Conditional is `\lif` and defaults to $\rightarrow$. To use a
% different symbol, replace `\rightarrow` in the definition, e.g., by
% `\supset`
\DeclareDocumentMacro \lif {\mathbin{\rightarrow}}
% - The biconditional is `\liff` and defaults to $\leftrightarrow$. To
% use the triple bar $\equiv$ replace with `\equiv`.
\DeclareDocumentMacro \liff {\mathbin{\leftrightarrow}}
% - The conditional `\cif` and defaults to `\boxright` which produces
% - Lewis's box-arrow symbol.
\DeclareDocumentMacro \cif {\boxright}
% - The strict conditional `\strictif`
\DeclareDocumentMacro \strictif {\fishhookright}
% Quantifiers
% -----------
% The quantifier symbols are provided as commands `\lexists` and
% `\lforall` which take two optional arguments. If no arguments are
% provided, it they just typeset the quantifier symbol. With one
% optional argument they produce the quantifier together with a
% variable, and this may include parenthesesaround the quantifier and
% variable. The second optional argument producesthe
% quantifier/variable combination plus the formula in the scope of the
% formula with appropriate spacing. For instance,
% `\lexists[x][!A(x)]` will, by default, produce $\exists
% x\,\varphi(x)$.
% - The existential quantifier is `\lexists`. Replace `\exists` with
% `\boldsymbol{\exists}` for boldface, or redefine appropriately if
% you want parentheses around $\exists x$.
\DeclareDocumentCommand \lexists { t{!} o o } {
\exists
\IfBooleanTF {#1}
\mathexclaim % unique
\relax % not unique
\IfNoValueTF {#2}
\relax % no arguments
{ #2 } % one argument: variable
\IfNoValueTF {#3}
\relax
{ \, #3 } % two arguments: space and matrix
}
% - The universal quantifier is `\lforall`.
\DeclareDocumentCommand \lforall { o o } {
\IfNoValueTF {#1}
{ \forall } % no arguments
{ \forall #1 } % one argument: variable
\IfNoValueTF {#2}
\relax
{ \, #2 } % two arguments: space and matrix
}
% - The identity relation is also provided as `\eq`. By itself, it
% produces the identity reation symbol (default: $=$) by itself. With
% two optional arguments, it typesets the corresponding atomic
% formula, e.g., `\eq[x][y]` produces $x = y$. `\eq/` produces the
% negated symbol (formula).
\DeclareDocumentCommand \eq { t{/} o o } {
\IfNoValueTF {#3}
% no optional arguments: just typeset symbol
{ \IfBooleanTF{#1}{ \neq }{ = } }
% optional arguments: typeset atomic formula
{ \IfBooleanTF{#1}{ #2 \neq #3}{#2 = #3} }
}
% Proofs and Derivations
% ----------------------
% - The sequent symbol `\Sequent` produces $\Rightarrow$ by
% default. Change the definition for $\vdash$, or another symbol.
\DeclareDocumentMacro \Sequent {\Rightarrow}
\DeclareDocumentMacro \nSequent {\mid}
% The sequent symbol in proofs displays as the above sequent symbol.
\DeclareDocumentMacro \fCenter {\ensuremath{\,\Sequent\,}}
% - Rule names: `\LeftR{Op}` typesets the name of a left rule for
% operator `Op`, e.g., `\LeftR{\land}` produces `$\land$L`.
% `\RightR{Op}` does the same for right rules.
\DeclareDocumentCommand \LeftR { m } {\ensuremath{{#1}\mathrm{L}}}
\DeclareDocumentCommand \RightR { m } {\ensuremath{{#1}\mathrm{R}}}
\DeclareDocumentCommand \iR { m m o} {\ensuremath{{#1\IfNoValueTF{#3}{}{_{#3}}}{#2}}}
% - `\Weakening`: produces name or abbreviation for weakening rule,
% e.g., ``W''.
\DeclareDocumentMacro \Weakening {\text{W}}
% - `\Contraction`: produces name or abbreviation for contraction rule,
% e.g., ``C''.
\DeclareDocumentMacro \Contraction {\text{C}}
% - `\Exchange`: produces name or abbreviation for exchange rule,
% e.g., ``X''.
\DeclareDocumentMacro \Exchange {\text{X}}
% - `\Cut`: produces name or abbreviation for cut rule,
% e.g., ``Cut''.
\DeclareDocumentMacro \Cut {\text{Cut}}
% - Rule names: `\Intro{Op}` typesets the name of an intro rule for
% operator `Op`, e.g., `\Intro{\land}` produces `$\land$Intro`.
% `\Elim{Op}` does the same for elimination rules.
\DeclareDocumentCommand \Intro { m } {\ensuremath{{#1}\mathrm{Intro}}}
\DeclareDocumentCommand \Elim { m } {\ensuremath{{#1}\mathrm{Elim}}}
% - `\FalseInt`, `\FalseCl`: produces name or abbreviation for
% intuitionistic and classical absurdity rule, e.g., ``$\bot_I$,''
% ``$\bot_C$''.
\DeclareDocumentMacro \FalseInt {\ensuremath{\lfalse_I}}
\DeclareDocumentMacro \FalseCl {\ensuremath{\lfalse_C}}
% - `\Discharge{!A}{n}`: typesets a discharged assumption with label
% $n$, e.g., $[!A]^n$.
\DeclareDocumentCommand \Discharge { m m }{[#1]^{#2}}
% - `\DischargeRule{Rule}{n}`: used in a `prooftree` environment to
% provide the labels for an inference that discharges an assumption.
\DeclareDocumentCommand \DischargeRule { m m }{
\RightLabel{#1}
\LeftLabel{\scriptsize $#2$}
}
% Proof Terms
% ---------------------
%
% Proof terms used in intuitionistic logic
\DeclareDocumentCommand \typeof { m m } {#1^{#2}}
\DeclareDocumentCommand \andi { m m } {\tuple{#1, #2}}
\DeclareDocumentCommand \ande { m m } {\fn{p}_{#1}(#2)}
\DeclareDocumentCommand \ori { m m m } {\fn{in}_{#1}^{#2}(#3)}
\DeclareDocumentCommand \ore { m m m m m } {\fn{case}(#1, #2.#3, #4.#5)}
\DeclareDocumentCommand \falsee { m m } {\fn{contr}_{#1}(#2)}
% Axiomatic Derivations
% ---------------------
% - `\MP`: produces abbreviation for Modus Ponens.
\DeclareDocumentMacro \MP {\textsc{mp}}
% - `\QR`: produces abbreviation for Quantifier Rule.
\DeclareDocumentMacro \QR {\textsc{qr}}
% - `\Hyp`: produces abbreviation for Hypothesis.
\DeclareDocumentMacro \Hyp {\textsc{Hyp}}
% - `\sFmla`: Signed (prefixed) formulas in running text
\DeclareDocumentCommand \sFmla { m m o }{
\ensuremath{%
\IfNoValueTF{#3}{}{#3\,}%
\hbox to.8em{\ensuremath{#1}\hfil} #2}}
% - `\pFmla`: signed prefixed formulas for tableaux
\DeclareDocumentCommand \pFmla { m m m }{
\ensuremath{%
\hskip 3em{\llap{$#3$}\,}%
\hbox to1.3em{\ensuremath{#1}\hfil} #2}}
% Tableaux
% --------
% - Tableau rule names: `\TRule{Sign}{Op}` typesets the name of a the
% `Sign` rule for operator `Op`, `\TFalse{Op}` does the same for
% `False` rules. The optional argument contains the line number to
% which the rule is applied.
\DeclareDocumentCommand \TRule { m m o }{%
\ensuremath{{#2}{#1}\IfNoValueTF{#3}{}{\, #3}}}
% - `\TAss`: justification label for ``assumption''
\DeclareDocumentMacro \TAss {Assumption}
% Metalogical Relations
% ---------------------
%
% Metalogical relationships, such as truth in a structure, validity,
% consequence, and provability, are also provided as commands. Uniform
% use of these commandsinstead of hard-coded typesetting according to
% specific conventions guarantees that by changing the definitions
% below you can uniformly change notation in the text.
% ### Substitution
% -`\subst{t}{x}`: typeset the substitution notation
\DeclareDocumentCommand \subst { m m } {#1/#2}
% - `\SSubst{A}{s}`: typeset simultaneous substitution (expects $s$ to
% be a list of `\subst{t}{x}` expressions, say)
\DeclareDocumentCommand \SSubst { m m } {
#1[#2]}
% - `\Subst{!A}{t}{x}`: The operation of substituting a term for a
% (free) variable in another term or in a formula. The default is
% $\varphi[x/t]$, other common notations are $\varphi^t_x$,
% $\varphi\{t \rightarrow x\}$, or $S^t_x \varphi$.
\DeclareDocumentCommand \Subst { m m m } {
#1[\subst{#2}{#3}]}
% ### pre-Substitution
\DeclareDocumentCommand \pSubst { m m m } {
#1[#2/#3]^{-}
}
% ### The satisfaction/truth relation
% - `\Sat[/]{M}{!A}[s]`, the relation of being satisfied in a
% structure (relative to an assignment), is provided as the command
% `\Sat` with two mandatory arguents (the structure and the formula)
% and one optional argument (the assignment). Use `\Sat/` to create
% the negated relation. By default, `\Sat{M}{!A}[s]` is typeset as
% $\mathfrak{M}, s \models \varphi$.
\DeclareDocumentCommand \Sat { t{/} m m o } {
\IfBooleanTF{#1}{
% negated
\IfNoValueTF {#4}
{ \Struct{#2} \nvDash #3 }
{ \Struct{#2}, #4 \nvDash #3}}{
% not negated
\IfNoValueTF {#4}
{ \Struct{#2} \vDash #3 }
{ \Struct{#2}, #4 \vDash #3 }}
}
% ### The derivability relation
% `\Proves[L]` is used to create the symbol for the derivability
% relation, `\Proves/` for the negation. By default this creates
% $\vdash$; e.g., `\Gamma \Proves !A` yields $\Gamma \vdash
% \varphi$. An optional argument may be used for the calculus or logic
% relative to which the provability relation is defined; by default it
% creates a subscript on the turnstile.
\DeclareDocumentCommand \Proves { t{/} o } {
\IfBooleanTF {#1}{
\IfNoValueTF {#2}
{ \nvdash }
{ \nvdash_{#2} }}{
\IfNoValueTF {#2}
{ \vdash }
{ \vdash_{#2} }}
}
% - `\Thms{X}`: theorems a set of formulas
\DeclareDocumentCommand \Thms { m } {\mathrm{Thm}(#1)}
% - `\PAx`: the set of propositional axioms
\DeclareDocumentMacro \PAx { \mathrm{Ax}_0 }
% ### The semantic consequence relation relation
% `\Entails` is the semantic counterpart of `\Proves` and defaults to
% $\vDash$. It also takes an optional `/` for $\nvDash$ and an
% optional argument for a subscript.
\DeclareDocumentCommand \Entails { t{/} o } {
\IfBooleanTF {#1}{
\IfNoValueTF {#2}
{ \nvDash }
{ \nvDash_{#2} }}{
\IfNoValueTF {#2}
{ \vDash }
{ \vDash_{#2} }}
}
% ### Model-theoretic notions and symbols
% - `\Domain{M}` - domain of a structure, e.g., `\Domain{M}` gives
% $\left|\mathfrak M\right|$.
\DeclareDocumentCommand \Domain { m }{\left| \Struct{#1} \right|}
% - `\Assign{R}{M}` - Assignment (value of) of a constant/predicate symbol
% in a structure; e.g., `\Assign{R}{M}` produces $R^\mathfrak{M}$.
\DeclareDocumentCommand \Assign { m m }{\mathord{#1^{\Struct{#2}}}}
% - `\varAssign{s'}{s}{x}[o]` - Assignment variant. Takes three mandatory
% argument (s' differs from s at most at x) and one optional one (s' assigns
% o to x. Default: `\varAssign{s'}{s}{x}` produces `s' \sim_{x} s`
% and `\varAssign{s'}{s}{x}[o] produces `s' = s[o/x]`.
\DeclareDocumentCommand \varAssign { m m m o } {
\IfNoValueTF {#4}
% optional argument not present
{ #1 \sim_{#3} #2 }
% optional argument present
{ #1 = #2[^{#4}/{#3}] }
}
% - `\Value{t}{M}[s]` - Value of a term in a structure. Takes two mandatory
% arguments (term and structure) and one optional argument (variable
% assignment). By default, `\Value{t}{M}[s]` produces
% $\mathrm{Val}^\mathfrak{M}_s(t)$.
\DeclareDocumentCommand \Value { m m o} {
\IfNoValueTF {#3}
% optional argument not present
{ \mathrm{Val}^{\Struct{#2}}(#1) }
% optional argument present
{ \mathrm{Val}^{\Struct{#2}}_{#3}(#1) }
}
% - `\pAssign{v}` - Typeset a truth-value assignment
\DeclareDocumentCommand \pAssign { m } {\applytofirst{\mathfrak}{#1}}
% - `\pValue{v}(A)[L]` - Truth value of a formula under a truth-value assignment.
\DeclareDocumentCommand \pValue { m d() o}{
\overline{\pAssign{#1}}%
\IfNoValueTF{#3}{}{_{#3}}%
\IfNoValueTF {#2}{}{(#2)}
}
% - `\pSat[/]{v}{!A}[L]`, the relation of being satisfied by a
% truth-value assignment in a logic L.
\DeclareDocumentCommand \pSat { t{/} m m o } {
\pAssign{#2}
\IfBooleanTF{#1}{\nvDash}{\vDash}%
\IfNoValueTF{#4}{}{_{#4}}
#3
}
% - `\tf{\star}[L]`: truth function for $\star$ in $\mathbf{L}$
\DeclareDocumentCommand \tf { m o } {
\widetilde{#1}%
\IfNoValueTF{#2}{}{_{#2}}
}
% - `\substruct`: symbol for the substructure relation
\DeclareDocumentMacro \substruct {\subseteq}
% - `\Theory{M}`: theory of a structure
\DeclareDocumentCommand \Theory { m } {\mathrm{Th}(\Struct{#1})}
% - `\Mod[L](L'){T}`: class of models of a theory/sentence $T$ in a
% language $\mathcal{L}$ and logic $L'$.
\DeclareDocumentCommand \Mod { o d() m } {
\IfNoValueTF {#2} {
% optional logic argument not present
\IfNoValueTF {#1}{
\mathrm{Mod}(#3) }{
\mathrm{Mod}^{\Lang{#1}}(#3) }}{
% optional logic argument present
\IfNoValueTF {#1}{
\mathrm{Mod}_{#2}(#3)}{
\mathrm{Mod}_{#2}^{\Lang{#1}}(#3)}}
}
% - `\elemequiv`: elementary equivalence (infix relation)
\DeclareDocumentCommand \elemequiv { t{/} o } {
\IfBooleanTF {#1}{
\IfNoValueTF {#2}
{ \not\equiv }
{ \not\equiv_{#2} }}{
\IfNoValueTF {#2}
{ \equiv }
{ \equiv_{#2} }}
}
% - `\eqc`: the equivalence class the element (first argument) belongs
% to; second argument is used to mark the equivalence relation if
% there's more than one
\DeclareDocumentCommand \eqc { m o } {
\IfNoValueTF {#2}
{[#1]}
{[#1]_{#2}}
}
% - `\rep`: the representative of an equivalence class, the second
% argument is used to mark the equivalence relation if there's more
% than one
\DeclareDocumentCommand \rep { m o } {
\IfNoValueTF {#2}
{\underline{#1}}
{{\underline{#1}}_{#2}}
}
% - `\iso[/][p]`: relation of being (partially) isomorphic
\DeclareDocumentCommand \iso { t{/} o } {
\IfBooleanTF {#1}{
\IfNoValueTF {#2}
{ \not\simeq }
{ \not\simeq_{#2} }}{
\IfNoValueTF {#2}
{ \simeq }
{ \simeq_{#2} }}
}
% - `\ident`: syntactic identity between expressions (infix relation),
\DeclareDocumentMacro \ident {\equiv}
% - `\QuantRank{!A}`: quantifier rank of a formula
\DeclareDocumentCommand \QuantRank { m } {\mathrm{qr}(#1)}
% - `\Expan{M}{R}`: expansion of a structure by a relation (etc.)
\DeclareDocumentCommand \Expan { m m } {(\Struct{#1}, #2)}
% `\nssucc`, `\nsplus`, `\nstimes`, `\nsless`: non-standard
% arithmetical operations
\DeclareDocumentMacro \nszero {\mathbf{z}}
\DeclareDocumentMacro \nssucc {*}
\DeclareDocumentMacro \nsplus {\oplus}
\DeclareDocumentMacro \nstimes {\otimes}
\RequirePackage{stmaryrd}
\DeclareDocumentMacro \nsless {\varolessthan}
% Recursion-theoretic Notions and Symbols
% ---------------------------------------
% - `\Proj{n}{i}`: projection functions
\DeclareDocumentCommand \Proj { m m } {P^{#1}_{#2}}
% - `\Zero`: the constant zero function
\DeclareDocumentMacro \Zero {\fn{zero}}
% - `\Succ`: the successor function
\DeclareDocumentMacro \Succ {\fn{succ}}
% - `\Add`: the addition function
\DeclareDocumentMacro \Add {\fn{add}}
% - `\Mult`: the multiplication function
\DeclareDocumentMacro \Mult {\fn{mult}}
% - `\Exp`: the exponentiation function
\DeclareDocumentMacro \Exp {\fn{exp}}
% - `\Pred`: the successor function
\DeclareDocumentMacro \Pred {\fn{pred}}
% - `\tsub`: truncated subtraction function
\DeclareDocumentMacro \tsub {\mathbin{\dot-}}
% - `\Char{R}`: characteristic function
\DeclareDocumentCommand \Char { m } {\chi_{#1}}
% - `\defis`: definitional identity
\DeclareDocumentMacro \defis {=} %{\mathrel{=_\mathrm{df}}}
% - `\defiff`: definitional equivalence
\DeclareDocumentMacro \defiff {\Leftrightarrow}
% - `\concat`: concatenation of sequences
\DeclareDocumentMacro \concat {\frown}
% - `\umin{x}{!A}`: unbounded minimization
\DeclareDocumentCommand \umin { m m } {\mu #1 \; #2}
% - `\bmin{x < y}{!A}`: bounded minimization
\DeclareDocumentCommand \bmin { m m } {(\fn{min} \; #1)\, #2}
% - `\bexists{x < y}{!A}`: bounded existential quantification
\DeclareDocumentCommand \bexists { m m } {(\exists #1)\; #2}
% - `\bforall{x < y}{!A}`: bounded univeral quantification
\DeclareDocumentCommand \bforall { m m } {(\forall #1)\; #2}
% - `\cfind{e}[n]`: partial computable function with index $e$
\DeclareDocumentCommand \cfind { m o } {%
\IfNoValueTF {#2}
% optional argument not present
{ \varphi_{#1} }
% optional argument present
{ \varphi_{#1}^{#2} }
}
% - `\redone`: one-step reduction
\DeclareDocumentCommand \redone { o } {
\IfNoValueTF {#1}
{\xrightarrow{}}
{\xrightarrow{#1}}
}
\DeclareDocumentMacro \aconvone {\redone[\alpha]}
\DeclareDocumentMacro \bredone {\redone[\beta]}
\DeclareDocumentMacro \eredone {\redone[\eta]}
\DeclareDocumentMacro \beredone {\redone[\beta\eta]}
\DeclareDocumentMacro \xredone {\redone[X]}
% - `\red`: reduction
\DeclareDocumentCommand \xrightarrowdbl { o m } {
\IfNoValueTF {#1}
{\xrightarrow{#2} \mathrel{\mkern-14mu}\rightarrow}
{\xrightarrow[#1]{#2} \mathrel{\mkern-14mu}\rightarrow}
}
\DeclareDocumentCommand \red { o } {
\IfNoValueTF {#1}
{\xrightarrowdbl{}}
{\xrightarrowdbl{#1}}
}
\DeclareDocumentMacro \aconv {\red [\alpha]}
\DeclareDocumentMacro \bred {\red [\beta]}
\DeclareDocumentMacro \ered {\red [\eta]}
\DeclareDocumentMacro \bered {\red [\beta\eta]}
\DeclareDocumentMacro \xred {\red [X]}
% - `\equal`: equivalence relation with some letter over the symbol
\DeclareDocumentCommand \equal { o } {
\IfNoValueTF {#1}
{\eq}
{\stackrel{#1}{\eq}}
}
\DeclareDocumentMacro \aeq {\equal [\alpha]}
% - `\eqs`: syntactic equivalent
\DeclareDocumentMacro \eqs {\equiv}
% - `\redpar`: parallel reduction
\DeclareDocumentCommand \redpar { o } {
\IfNoValueTF {#1}
{\xLongrightarrow{}}
{\xLongrightarrow{#1}}
}
\DeclareDocumentMacro \bredpar {\redpar [\beta]}
\DeclareDocumentMacro \beredpar {\redpar [\beta\eta]}
\DeclareDocumentMacro \eqa {\equal{\alpha}}
\DeclareDocumentMacro \eqe {\equal{\eta}}
\DeclareDocumentMacro \ext {\ensuremath{\mathit{ext}}}
% - `\cd`: complete development
\DeclareDocumentCommand \cd { o m } {
\IfNoValueTF {#1}
{{ #2 }^*}
{{ #2 }^{* {#1} }}
}
\DeclareDocumentCommand \bcd { m } {
\cd[\beta]{#1}
}
\DeclareDocumentCommand \becd { m } {
\cd[\beta\eta]{#1}
}
% - `\lambd[x][!A]`: lambda abstract
\DeclareDocumentCommand \lambd { o o } {
\IfNoValueTF {#1}
{ \lambda } % no arguments
{ \lambda #1 } % one argument
\IfNoValueTF {#2}
\relax
{ .\, #2 } % two arguments
}
% - `\num{n}` : numeral corresponding to a number
\DeclareDocumentCommand \num { m } {\overline{#1}}
% - `\scode{s}`: code for a symbol
\DeclareDocumentCommand \scode { m } {\fn{c}_{#1}}
% - `\Gn{!A}`: G\"odel number of a string of symbols
\DeclareDocumentCommand \Gn { m } {{^{\reflectbox{\tiny\#}}}{#1}{^{\mbox{\tiny\#}}}}
% Modal Logic
% -----------
% Modal logic
% ===========
% - `\mModel{M}` - modal structures; default: set first token in
% Fraktur
\DeclareDocumentCommand \mModel { m }{\applytofirst{\mathfrak}{#1}}
% `\mSat[/]{M}{!A}[w]`, the relation of being satisfied in a
% model (at a world), is provided as the command
% `\mSat` with two mandatory arguments (the model and the formula)
% and one optional argument (the world). Use `\mSat/` to create
% the negated relation. By default, `\mSat{M}{!A}[w]` is typeset as
% $\mathfrak{M}, w \models \varphi$.
\DeclareDocumentCommand \mSat { t{/} m m o } {%
\IfBooleanTF{#1}{%
% negated
\IfNoValueTF {#4}
{ \mModel{#2} \nVdash #3 }
{ \mModel{#2}, #4 \nVdash #3}}{%
% not negated
\IfNoValueTF {#4}
{ \mModel{#2} \Vdash #3 }
{ \mModel{#2}, #4 \Vdash #3 }}}
% - `\mClass{C}` --- typeset class of models
\DeclareDocumentCommand \mClass { m }{\mathcal{#1}}
% - `\Nec`: produces abbreviation for Necessitation.
\DeclareDocumentMacro \Nec {\textsc{nec}}
% - `\RK`: produces abbreviation for Rule K
\DeclareDocumentMacro \RK {\textsc{rk}}
% - `\Dual`: produces abbreviation for Dual
\DeclareDocumentMacro \Dual {\textsc{dual}}
% - `\Taut`: produces abbreviation for Dual
\DeclareDocumentMacro \Taut {\textsc{taut}}
% - `\PL`: produces abbreviation for ``Propositional Logic''
\DeclareDocumentMacro \PL {\textsc{pl}}
% - `\Prop{M}{A}`: the proposition defined by $A$ in $\mathfrak{M}$
\DeclareDocumentCommand \Prop { m m } {
{[\!\![} #2 {]\!\!]_{\mModel{#1}}}
}
% - `\ST`: The standard translation
\DeclareDocumentMacro \ST {\mathord{\mathrm{ST}}}
% - TikZ style for modal models
\tikzset{
modal/.style={>=stealth',
shorten >=1pt,
shorten <=1pt,
auto,
node distance=1.5cm,
label distance=2pt,
semithick},
every label/.style={phantom,align=left},
world/.style = {circle,draw,minimum size=0.5cm,fill=gray!15},
modal every node/.style={world},
point/.style={circle,draw,inner sep=0.5mm,fill=black},
phantom/.style={rectangle,inner sep=0pt,draw=none,fill=none},
reflexive above/.style={->,loop,looseness=7,in=60,out=120},
reflexive below/.style={->,loop,looseness=7,in=240,out=300},
reflexive left/.style={->,loop,looseness=7,in=150,out=210},
reflexive right/.style={->,loop,looseness=7,in=30,out=330}
}
\DeclareDocumentCommand \mTrue { m }{\ensuremath{#1}}
\DeclareDocumentCommand \mFalse { m }{\ensuremath{\lnot #1}}
% Special Sets and Mathematical Symbols
% -------------------------------------
% ### Set-theoretic operators
% - Set abstracts: Use `\Setabs{x}{!A(x)}` to produce the set abstract
% $\{ x : \varphi(x) \}$. If you prefer a $\mid$ to :, change the
% definition accordingly.
\DeclareDocumentCommand \Setabs { m m }{\{ #1 : #2 \}}
% - Fregean extensions: Use `\fregeext{x}{!A(x)}` to produce
% $\epsilon x\, !A(x)$.
\DeclareDocumentCommand \fregeext { m m }{\oldepsilon #1 \, #2 }
% - Fregean number: Use `\fregenum{x}{!A(x)}` to produce
% $\# x\, !A(x)$.
\DeclareDocumentCommand \fregenum { m m }{\# #1 \, #2 }
% - `\Pow{X}`: Power set, produces $\wp(X)$
\DeclareDocumentCommand \Pow { m }{\wp(#1)}
% - `\dom{f}`: domain of a function
\DeclareDocumentCommand \dom { m }{\fn{dom}(#1)}
% - `\ran{f}`: range of a function
\DeclareDocumentCommand \ran { m }{\fn{ran}(#1)}
% - `\len{s}`: length of a sequence
\DeclareDocumentCommand \len { m }{\fn{len}(#1)}
% - `\emptyseq`: the empty sequence
\DeclareDocumentMacro \emptyseq {\Lambda}
% - `\restrict`: restriction of a function to a set (infix operator)
\DeclareDocumentMacro \restrict {\upharpoonright}
% - `\Complement{X}`: complement of a set
\DeclareDocumentCommand \Complement { m } {\overline{#1}}
% - `\card{X}`: cardinality of a set
\DeclareDocumentCommand \card { m } {\left| #1 \right|}
% - `\cardle{X}{Y}`: X is no larger than Y
\DeclareDocumentCommand \cardle { m m } {#1 \preceq #2}
% - `\cardless{X}{Y}`: X is smaller than Y
\DeclareDocumentCommand \cardless { m m } {#1 \prec #2}
% - `\cardeq{X}{Y}`: X is equinumerous with Y
\DeclareDocumentCommand \cardeq { m m } {#1 \approx #2}
% - `\tuple{x,y}`: pairs, tuples, sequences
\DeclareDocumentMacro \openTuple {\langle}
\DeclareDocumentMacro \closeTuple {\rangle}
\DeclareDocumentCommand \tuple { m } {\openTuple #1 \closeTuple}
% - `\comp{f}{g}`: composition of f with g, defaults to $g \circ f$
\DeclareDocumentCommand \comp { m m }{#2 \circ #1}
% - `\pto`: partial function arrow
\DeclareDocumentMacro \pto {\mathrel{\ooalign{\hfil$\mapstochar\mkern
5mu$\hfil\cr$\to$}}}
% - `\fdefined`, `\fundefined`: postfix for defined, undefined
% functions
\DeclareDocumentMacro \fdefined {\downarrow}
\DeclareDocumentMacro \fundefined {\uparrow}
% - `cutrank`: cut rank
\DeclareDocumentCommand \cutrank { m }{\fn{cr}(#1)}
% - `maxrank`: max rank
\DeclareDocumentCommand \maxrank { m }{\fn{mr}(#1)}
% ### Particular sets
% - Natural numbers: `\Nat`
\DeclareDocumentMacro \Nat {\mathbb{N}}
% - Integers: `\Int`
\DeclareDocumentMacro \Int {\mathbb{Z}}
% - Positive integers: `\PosInt`
\DeclareDocumentMacro \PosInt {\mathbb{Z}^+}
% - Real numbers: `\Real`
\DeclareDocumentMacro \Real {\mathbb{R}}
% - Rational numbers: `\Rat`
\DeclareDocumentMacro \Rat {\mathbb{Q}}
% - The set $\{0, 1\}$: `\Bin`
\DeclareDocumentMacro \Bin {\mathbb{B}}
% - Identity relation: `\Id{X}`
\DeclareDocumentCommand \Id { m } {\mathord{\mathrm{Id}_{#1}}}
% Topological notions
% -------------------
% - `\Top{O}`: Open sets
\DeclareDocumentCommand \Top { m }{\mathcal{#1}}
% - `\Interior{V}`: the interior of $V$
\DeclareDocumentCommand \Interior { m }{\mathrm{Int}(#1)}
% ### Symbols for Turing Machines
% - `\TMendtape` - symbol indicating left end of tape
\DeclareDocumentMacro \TMendtape {\triangleright}
% - `\TMblank` - symbol for a blank
\DeclareDocumentMacro \TMblank {0}
% - `\TMstroke` - single stroke symbol on tape
\DeclareDocumentMacro \TMstroke {1}
% - `\TMright` - symbol for move right instruction
\DeclareDocumentMacro \TMright {R}
% - `\TMleft` - symbol for move left instruction
\DeclareDocumentMacro \TMleft {L}
% - `\TMstay` - symbol for the stay instruction
\DeclareDocumentMacro \TMstay {N}
% - `\TMtrans` - typeset a TM transition
\DeclareDocumentCommand \TMtrans { m m m } {\ensuremath{#1, #2, #3}}
% ### Functions and Function/Relation symbols
% - `\Part`: the parthood predicate
\DeclareDocumentCommand \Part { m m } {\Atom{\Obj P}{#1, #2}}
% - `\Prf`: the proof relation
\DeclareDocumentCommand \Prf { o } { \mathrm{Prf}\IfNoValueTF {#1} {} {_{#1}}}
\DeclareDocumentCommand \OPrf { o } { \mathsf{Prf}\IfNoValueTF {#1} {} {_{#1}}}
% - `\Refut`: the refutation relation
\DeclareDocumentCommand \Refut { o } { \mathrm{Ref}\IfNoValueTF {#1} {} {_{#1}}}
\DeclareDocumentCommand \ORefut { o } { \mathsf{Ref}\IfNoValueTF {#1} {} {_{#1}}}
% - `\Prov`: the provability predicate
\DeclareDocumentCommand \Prov { o } { \mathrm{Prov}\IfNoValueTF {#1} {} {_{#1}}}
\DeclareDocumentCommand \OProv { o } { \mathsf{Prov}\IfNoValueTF {#1} {} {_{#1}}}
% - `\RProv`: the Rosser provability relation
\DeclareDocumentCommand \RProv { o } { \mathrm{RProv}\IfNoValueTF {#1} {} {_{#1}}}
\DeclareDocumentCommand \ORProv { o } { \mathsf{RProv}\IfNoValueTF {#1} {} {_{#1}}}
% - `\OCon`: the consistency statement
\DeclareDocumentCommand \OCon { o } { \mathsf{Con}\IfNoValueTF {#1} {} {_{#1}}}