forked from metamath/set.mm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hol.mm
2247 lines (2022 loc) · 85.2 KB
/
hol.mm
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
$( hol.mm 7-Oct-2014 $)
$(
~~ PUBLIC DOMAIN ~~
This work is waived of all rights, including copyright, according to the CC0
Public Domain Dedication. http://creativecommons.org/publicdomain/zero/1.0/
Mario Carneiro - email: di.gama at gmail.com
$)
$(
#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
Foundations
#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
$)
$( Declare the primitive constant symbols for lambda calculus. $)
$c var $. $( Typecode for variables (syntax) $)
$c type $. $( Typecode for types (syntax) $)
$c term $. $( Typecode for terms (syntax) $)
$c |- $. $( Typecode for theorems (logical) $)
$c : $. $( Typehood indicator $)
$c . $. $( Separator $)
$c |= $. $( Context separator $)
$c bool $. $( Boolean type $)
$c ind $. $( 'Individual' type $)
$c -> $. $( Function type $)
$c ( $. $( Open parenthesis $)
$c ) $. $( Close parenthesis $)
$c , $. $( Context comma $)
$c \ $. $( Lambda expression $)
$c = $. $( Equality term $)
$c T. $. $( Truth term $)
$c [ $. $( Infix operator $)
$c ] $. $( Infix operator $)
$v al $. $( Greek alpha $)
$v be $. $( Greek beta $)
$v ga $. $( Greek gamma $)
$v de $. $( Greek delta $)
$v x y z f g p q $. $( Bound variables $)
$v A B C F R S T $. $( Term variables $)
$( Let variable ` al ` be a type. $)
hal $f type al $.
$( Let variable ` be ` be a type. $)
hbe $f type be $.
$( Let variable ` ga ` be a type. $)
hga $f type ga $.
$( Let variable ` de ` be a type. $)
hde $f type de $.
$( Let variable ` x ` be a var. $)
vx $f var x $.
$( Let variable ` y ` be a var. $)
vy $f var y $.
$( Let variable ` z ` be a var. $)
vz $f var z $.
$( Let variable ` f ` be a var. $)
vf $f var f $.
$( Let variable ` g ` be a var. $)
vg $f var g $.
$( Let variable ` p ` be a var. $)
vp $f var p $.
$( Let variable ` q ` be a var. $)
vq $f var q $.
$( Let variable ` A ` be a term. $)
ta $f term A $.
$( Let variable ` B ` be a term. $)
tb $f term B $.
$( Let variable ` C ` be a term. $)
tc $f term C $.
$( Let variable ` F ` be a term. $)
tf $f term F $.
$( Let variable ` R ` be a term. $)
tr $f term R $.
$( Let variable ` S ` be a term. $)
ts $f term S $.
$( Let variable ` T ` be a term. $)
tt $f term T $.
$( A var is a term. $)
tv $a term x : al $.
$( The type of all functions from type ` al ` to type ` be ` . $)
ht $a type ( al -> be ) $.
$( The type of booleans (true and false). $)
hb $a type bool $.
$( The type of individuals. $)
hi $a type ind $.
$( A combination (function application). $)
kc $a term ( F T ) $.
$( A lambda abstraction. $)
kl $a term \ x : al . T $.
$( The equality term. $)
ke $a term = $.
$( Truth term. $)
kt $a term T. $.
$( Infix operator. $)
kbr $a term [ A F B ] $.
$( Context operator. $)
kct $a term ( A , B ) $.
$c wff $. $( Not used; for mmj2 compatibility $)
$( Internal axiom for mmj2 use. $)
wffMMJ2 $a wff A |= B $.
$( Internal axiom for mmj2 use. $)
wffMMJ2t $a wff A : al $.
${
idi.1 $e |- R |= A $.
$( The identity inference. $)
idi $p |- R |= A $=
( ) C $.
$( [9-Oct-2014] $)
$}
${
idt.1 $e |- A : al $.
$( The identity inference. $)
idt $p |- A : al $=
( ) C $.
$( [9-Oct-2014] $)
$}
${
ax-syl.1 $e |- R |= S $.
ax-syl.2 $e |- S |= T $.
$( Syllogism inference. $)
ax-syl $a |- R |= T $.
$( Syllogism inference. $)
syl $p |- R |= T $=
( ax-syl ) ABCDEF $.
$( [8-Oct-2014] $)
$}
${
ax-jca.1 $e |- R |= S $.
ax-jca.2 $e |- R |= T $.
$( Join common antecedents. $)
ax-jca $a |- R |= ( S , T ) $.
$( Syllogism inference. $)
jca $p |- R |= ( S , T ) $=
( ax-jca ) ABCDEF $.
$( [8-Oct-2014] $)
$}
${
syl2anc.1 $e |- R |= S $.
syl2anc.2 $e |- R |= T $.
syl2anc.3 $e |- ( S , T ) |= A $.
$( Syllogism inference. $)
syl2anc $p |- R |= A $=
( kct jca syl ) BCDHABCDEFIGJ $.
$( [7-Oct-2014] $)
$}
${
ax-simpl.1 $e |- R : bool $.
ax-simpl.2 $e |- S : bool $.
$( Extract an assumption from the context. $)
ax-simpl $a |- ( R , S ) |= R $.
$( Extract an assumption from the context. $)
ax-simpr $a |- ( R , S ) |= S $.
$( Extract an assumption from the context. $)
simpl $p |- ( R , S ) |= R $=
( ax-simpl ) ABCDE $.
$( [8-Oct-2014] $)
$( Extract an assumption from the context. $)
simpr $p |- ( R , S ) |= S $=
( ax-simpr ) ABCDE $.
$( [8-Oct-2014] $)
$}
${
ax-id.1 $e |- R : bool $.
$( The identity inference. $)
ax-id $a |- R |= R $.
$( The identity inference. $)
id $p |- R |= R $=
( ax-id ) ABC $.
$( [7-Oct-2014] $)
$}
${
ax-trud.1 $e |- R : bool $.
$( Deduction form of ~ tru . $)
ax-trud $a |- R |= T. $.
$( Deduction form of ~ tru . $)
trud $p |- R |= T. $=
( ax-trud ) ABC $.
$( [7-Oct-2014] $)
ax-a1i.2 $e |- T. |= A $.
$( Change an empty context into any context. $)
a1i $p |- R |= A $=
( kt ax-trud syl ) BEABCFDG $.
$( [7-Oct-2014] $)
$}
${
ax-cb.1 $e |- R |= A $.
$( A context has type boolean.
This and the next few axioms are not strictly necessary, and are
conservative on any theorem for which every variable has a specified
type, but by adding this axiom we can save some typehood hypotheses in
many theorems. The easy way to see that this axiom is conservative is
to note that every axiom and inference rule that constructs a theorem of
the form ` R |= A ` where ` R ` and ` A ` are type variables, also
ensures that ` R : bool ` and ` A : bool ` . Thus it is impossible to
prove any theorem ` |- R |= A ` unless both ` |- R : bool ` and
` |- A : bool ` had been previously derived, so it is conservative to
deduce ` |- R : bool ` from ` |- R |= A ` . The same remark applies to
the construction of the theorem ` ( A , B ) : bool ` - there is only one
rule that creates a formula of this type, namely ~ wct , and it requires
that ` A : bool ` and ` B : bool ` be previously established, so it is
safe to reverse the process in ~ wctl and ~ wctr . $)
ax-cb1 $a |- R : bool $.
$( A theorem has type boolean. (This axiom is unnecessary;
see ~ ax-cb1 .) $)
ax-cb2 $a |- A : bool $.
$}
${
wctl.1 $e |- ( S , T ) : bool $.
$( Reverse closure for the type of a context. (This axiom is unnecessary;
see ~ ax-cb1 .) $)
wctl $a |- S : bool $.
$( Reverse closure for the type of a context. (This axiom is unnecessary;
see ~ ax-cb1 .) $)
wctr $a |- T : bool $.
$}
${
mpdan.1 $e |- R |= S $.
mpdan.2 $e |- ( R , S ) |= T $.
$( Modus ponens deduction. $)
mpdan $p |- R |= T $=
( ax-cb1 id syl2anc ) CAABABADFGDEH $.
$( [8-Oct-2014] $)
$}
${
syldan.1 $e |- ( R , S ) |= T $.
syldan.2 $e |- ( R , T ) |= A $.
$( Syllogism inference. $)
syldan $p |- ( R , S ) |= A $=
( kct ax-cb1 wctl wctr simpl syl2anc ) ABCGZBDBCBCDMEHZIBCNJKEFL $.
$( [8-Oct-2014] $)
$}
${
simpld.1 $e |- R |= ( S , T ) $.
$( Extract an assumption from the context. $)
simpld $p |- R |= S $=
( kct ax-cb2 wctl wctr simpl syl ) ABCEZBDBCBCKADFZGBCLHIJ $.
$( [8-Oct-2014] $)
$( Extract an assumption from the context. $)
simprd $p |- R |= T $=
( kct ax-cb2 wctl wctr simpr syl ) ABCEZCDBCBCKADFZGBCLHIJ $.
$( [8-Oct-2014] $)
$}
${
trul.1 $e |- ( T. , R ) |= S $.
$( Deduction form of ~ tru . $)
trul $p |- R |= S $=
( kt kct ax-cb1 wctr trud id syl2anc ) BADAADABDAECFGZHAKICJ $.
$( [7-Oct-2014] $)
$}
$( The equality function has type ` al -> al -> bool ` , i.e. it is
polymorphic over all types, but the left and right type must agree. $)
weq $a |- = : ( al -> ( al -> bool ) ) $.
${
ax-refl.1 $e |- A : al $.
$( Reflexivity of equality. $)
ax-refl $a |- T. |= ( ( = A ) A ) $.
$}
$( Truth type. $)
wtru $p |- T. : bool $=
( ke kc kt hb ht weq ax-refl ax-cb1 ) AABABCDDDEEADFGH $.
$( [10-Oct-2014] $)
$( Tautology is provable. $)
tru $p |- T. |= T. $=
( kt wtru id ) ABC $.
$( [7-Oct-2014] $)
${
ax-eqmp.1 $e |- R |= A $.
ax-eqmp.2 $e |- R |= ( ( = A ) B ) $.
$( Modus ponens for equality. $)
ax-eqmp $a |- R |= B $.
$}
${
ax-ded.1 $e |- ( R , S ) |= T $.
ax-ded.2 $e |- ( R , T ) |= S $.
$( Deduction theorem for equality. $)
ax-ded $a |- R |= ( ( = S ) T ) $.
$}
${
wct.1 $e |- S : bool $.
wct.2 $e |- T : bool $.
$( The type of a context. $)
wct $a |- ( S , T ) : bool $.
$}
${
wc.1 $e |- F : ( al -> be ) $.
wc.2 $e |- T : al $.
$( The type of a combination. $)
wc $a |- ( F T ) : be $.
$}
${
ax-ceq.1 $e |- F : ( al -> be ) $.
ax-ceq.2 $e |- T : ( al -> be ) $.
ax-ceq.3 $e |- A : al $.
ax-ceq.4 $e |- B : al $.
$( Equality theorem for combination. $)
ax-ceq $a |- ( ( ( = F ) T ) , ( ( = A ) B ) ) |=
( ( = ( F A ) ) ( T B ) ) $.
$}
${
eqcomx.1 $e |- A : al $.
eqcomx.2 $e |- B : al $.
eqcomx.3 $e |- R |= ( ( = A ) B ) $.
$( Commutativity of equality. $)
eqcomx $p |- R |= ( ( = B ) A ) $=
( ke kc ax-cb1 ax-refl a1i hb ht weq ax-ceq syl2anc wc ax-eqmp ) HBIZBIZH
CIZBIZDUADTCIZDGJZABEKLZHUAIUCIDHTIUBIZUAUGDHHIHIZUDUHDUEAAMNZNHAOZKLGAUI
BCHHUJUJEFPQUFAMBBTUBAUIHBUJERAUIHCUJFREEPQS $.
$( [7-Oct-2014] $)
$}
${
mpbirx.1 $e |- B : bool $.
mpbirx.2 $e |- R |= A $.
mpbirx.3 $e |- R |= ( ( = B ) A ) $.
$( Deduction from equality inference. $)
mpbirx $p |- R |= B $=
( hb ax-cb2 eqcomx ax-eqmp ) ABCEGBACDACEHFIJ $.
$( [7-Oct-2014] $)
$}
${
ancoms.1 $e |- ( R , S ) |= T $.
$( Swap the two elements of a context. $)
ancoms $p |- ( S , R ) |= T $=
( kct ax-cb1 wctr wctl simpr simpl syl2anc ) CBAEABBAABCABEDFZGZABLHZIBAM
NJDK $.
$( [8-Oct-2014] $)
$}
${
adantr.1 $e |- R |= T $.
adantr.2 $e |- S : bool $.
$( Extract an assumption from the context. $)
adantr $p |- ( R , S ) |= T $=
( kct ax-cb1 simpl syl ) ABFACABCADGEHDI $.
$( [8-Oct-2014] $)
$( Extract an assumption from the context. $)
adantl $p |- ( S , R ) |= T $=
( adantr ancoms ) ABCABCDEFG $.
$( [8-Oct-2014] $)
$}
${
ct1.1 $e |- R |= S $.
ct1.2 $e |- T : bool $.
$( Introduce a right conjunct. $)
ct1 $p |- ( R , T ) |= ( S , T ) $=
( kct adantr ax-cb1 simpr jca ) ACFBCACBDEGACBADHEIJ $.
$( Introduce a left conjunct. $)
ct2 $p |- ( T , R ) |= ( T , S ) $=
( kct ax-cb1 simpl adantl jca ) CAFCBCAEBADGHACBDEIJ $.
$}
${
sylan.1 $e |- R |= S $.
sylan.2 $e |- ( S , T ) |= A $.
$( Syllogism inference. $)
sylan $p |- ( R , T ) |= A $=
( kct ax-cb1 wctr adantr simpr syl2anc ) ABDGCDBDCECDACDGFHIZJBDCBEHMKFL
$.
$( [8-Oct-2014] $)
$}
${
an32s.1 $e |- ( ( R , S ) , T ) |= A $.
$( Commutation identity for context. $)
an32s $p |- ( ( R , T ) , S ) |= A $=
( kct ax-cb1 wctl wctr simpl ct1 simpr adantr syl2anc ) ABDFZCFBCFZDOBCBD
BCPDAPDFEGZHZHZPDQIZJBCRIZKOCDBDSTLUAMEN $.
$( [8-Oct-2014] $)
$( Associativity for context. $)
anasss $p |- ( R , ( S , T ) ) |= A $=
( kct ax-cb1 wctl id ancoms sylan an32s ) CDFBAACBDACBFBCFZDBCMMMDAMDFEGH
IJEKLJ $.
$( [8-Oct-2014] $)
$}
${
anassrs.1 $e |- ( R , ( S , T ) ) |= A $.
$( Associativity for context. $)
anassrs $p |- ( ( R , S ) , T ) |= A $=
( kct ax-cb1 wctl wctr simpl adantr simpr ct1 syl2anc ) ABCFZDFBCDFZODBBC
BPABPFEGZHZCDBPQIZHZJCDSIZKOCDBCRTLUAMEN $.
$( [8-Oct-2014] $)
$}
$( The type of a typed variable. $)
wv $a |- x : al : al $.
${
wl.1 $e |- T : be $.
$( The type of a lambda abstraction. $)
wl $a |- \ x : al . T : ( al -> be ) $.
$}
${
ax-beta.1 $e |- A : be $.
$( Axiom of beta-substitution. $)
ax-beta $a |- T. |= ( ( = ( \ x : al . A x : al ) ) A ) $.
ax-distrc.2 $e |- B : al $.
ax-distrc.3 $e |- F : ( be -> ga ) $.
$( Distribution of combination over substitution. $)
ax-distrc $a |- T. |= ( ( = ( \ x : al . ( F A ) B ) )
( ( \ x : al . F B ) ( \ x : al . A B ) ) ) $.
$}
${
$d x R $.
ax-leq.1 $e |- A : be $.
ax-leq.2 $e |- B : be $.
ax-leq.3 $e |- R |= ( ( = A ) B ) $.
$( Equality theorem for abstraction. $)
ax-leq $a |- R |= ( ( = \ x : al . A ) \ x : al . B ) $.
$}
${
$d x y $. $d y B $.
ax-distrl.1 $e |- A : ga $.
ax-distrl.2 $e |- B : al $.
$( Distribution of lambda abstraction over substitution. $)
ax-distrl $a |- T. |=
( ( = ( \ x : al . \ y : be . A B ) ) \ y : be . ( \ x : al . A B ) ) $.
$}
${
wov.1 $e |- F : ( al -> ( be -> ga ) ) $.
wov.2 $e |- A : al $.
wov.3 $e |- B : be $.
$( Type of an infix operator. $)
wov $a |- [ A F B ] : ga $.
$( Infix operator. This is a simple metamath way of cleaning up the syntax
of all these infix operators to make them a bit more readable than the
curried representation. $)
df-ov $a |- T. |= ( ( = [ A F B ] ) ( ( F A ) B ) ) $.
$}
${
dfov1.1 $e |- F : ( al -> ( be -> bool ) ) $.
dfov1.2 $e |- A : al $.
dfov1.3 $e |- B : be $.
${
dfov1.4 $e |- R |= [ A F B ] $.
$( Forward direction of ~ df-ov . $)
dfov1 $p |- R |= ( ( F A ) B ) $=
( kbr kc ke ax-cb1 hb df-ov a1i ax-eqmp ) CDEKZECLDLZFJMSLTLFSFJNABOCDE
GHIPQR $.
$( [8-Oct-2014] $)
$}
dfov2.4 $e |- R |= ( ( F A ) B ) $.
$( Reverse direction of ~ df-ov . $)
dfov2 $p |- R |= [ A F B ] $=
( kc kbr hb wov ke ax-cb1 df-ov a1i mpbirx ) ECKDKZCDELZFABMCDEGHINJOUAKT
KFTFJPABMCDEGHIQRS $.
$( [8-Oct-2014] $)
$}
${
weqi.1 $e |- A : al $.
weqi.2 $e |- B : al $.
$( Type of an equality. $)
weqi $p |- [ A = B ] : bool $=
( hb ke weq wov ) AAFBCGAHDEI $.
$( [8-Oct-2014] $)
$}
${
eqcomi.1 $e |- A : al $.
eqcomi.2 $e |- R |= [ A = B ] $.
$( Deduce equality of types from equality of expressions. (This is
unnecessary but eliminates a lot of hypotheses.) $)
eqtypi $a |- B : al $.
$( Commutativity of equality. $)
eqcomi $p |- R |= [ B = A ] $=
( ke weq eqtypi dfov1 eqcomx dfov2 ) AACBGDAHZABCDEFIZEABCDENAABCGDMENFJK
L $.
$( [7-Oct-2014] $)
$}
${
eqtypri.1 $e |- A : al $.
eqtypri.2 $e |- R |= [ B = A ] $.
$( Deduce equality of types from equality of expressions. (This is
unnecessary but eliminates a lot of hypotheses.) $)
eqtypri $a |- B : al $.
$}
${
mpbi.1 $e |- R |= A $.
mpbi.2 $e |- R |= [ A = B ] $.
$( Deduction from equality inference. $)
mpbi $p |- R |= B $=
( hb ke weq ax-cb2 eqtypi dfov1 ax-eqmp ) ABCDFFABGCFHACDIZFABCMEJEKL $.
$( [7-Oct-2014] $)
$}
${
eqid.1 $e |- R : bool $.
eqid.2 $e |- A : al $.
$( Reflexivity of equality. $)
eqid $p |- R |= [ A = A ] $=
( ke weq kc ax-refl a1i dfov2 ) AABBFCAGEEFBHBHCDABEIJK $.
$( [7-Oct-2014] $)
$}
${
ded.1 $e |- ( R , S ) |= T $.
ded.2 $e |- ( R , T ) |= S $.
$( Deduction theorem for equality. $)
ded $p |- R |= [ S = T ] $=
( hb ke weq kct ax-cb2 ax-ded dfov2 ) FFBCGAFHBACIEJCABIDJABCDEKL $.
$( [7-Oct-2014] $)
$}
${
dedi.1 $e |- S |= T $.
dedi.2 $e |- T |= S $.
$( Deduction theorem for equality. $)
dedi $p |- T. |= [ S = T ] $=
( kt wtru adantl ded ) EABAEBCFGBEADFGH $.
$( [7-Oct-2014] $)
$}
${
eqtru.1 $e |- R |= A $.
$( If a statement is provable, then it is equivalent to truth. $)
eqtru $p |- R |= [ T. = A ] $=
( kt wtru adantr kct ax-cb1 ax-cb2 wct tru a1i ded ) BDABDACEFDBAGBAABCHA
BCIJKLM $.
$( [8-Oct-2014] $)
$}
${
mpbir.1 $e |- R |= A $.
mpbir.2 $e |- R |= [ B = A ] $.
$( Deduction from equality inference. $)
mpbir $p |- R |= B $=
( hb ax-cb2 eqtypri eqcomi mpbi ) ABCDFBACFABCACDGEHEIJ $.
$( [7-Oct-2014] $)
$}
${
ceq12.1 $e |- F : ( al -> be ) $.
ceq12.2 $e |- A : al $.
${
ceq12.3 $e |- R |= [ F = T ] $.
${
ceq12.4 $e |- R |= [ A = B ] $.
$( Equality theorem for combination. $)
ceq12 $p |- R |= [ ( F A ) = ( T B ) ] $=
( kc ke weq wc ht eqtypi dfov1 ax-ceq syl2anc dfov2 ) BBECLZGDLZMFBNA
BECHIOABGDABPZEGFHJQZACDFIKQZOMUBLUCLFMELGLMCLDLUDUDEGMFUDNHUEJRAACDM
FANIUFKRABCDEGHUEIUFSTUA $.
$( [7-Oct-2014] $)
$}
$( Equality theorem for combination. $)
ceq1 $p |- R |= [ ( F A ) = ( T A ) ] $=
( ke kbr ax-cb1 eqid ceq12 ) ABCCDEFGHIACEDFJKEILHMN $.
$( [7-Oct-2014] $)
$}
ceq2.3 $e |- R |= [ A = B ] $.
$( Equality theorem for combination. $)
ceq2 $p |- R |= [ ( F A ) = ( F B ) ] $=
( ht ke kbr ax-cb1 eqid ceq12 ) ABCDEFEGHABJEFCDKLFIMGNIO $.
$( [7-Oct-2014] $)
$}
${
$d x R $.
leq.1 $e |- A : be $.
leq.2 $e |- R |= [ A = B ] $.
$( Equality theorem for lambda abstraction. $)
leq $p |- R |= [ \ x : al . A = \ x : al . B ] $=
( ht kl ke weq wl eqtypi dfov1 ax-leq dfov2 ) ABIZRACDJACEJKFRLABCDGMABCE
BDEFGHNZMABCDEFGSBBDEKFBLGSHOPQ $.
$( [8-Oct-2014] $)
$}
${
beta.1 $e |- A : be $.
$( Axiom of beta-substitution. $)
beta $p |- T. |= [ ( \ x : al . A x : al ) = A ] $=
( kl tv kc ke kt weq wl wv wc ax-beta dfov2 ) BBACDFZACGZHDIJBKABQRABCDEL
ACMNEABCDEOP $.
$( [8-Oct-2014] $)
$}
${
distrc.1 $e |- F : ( be -> ga ) $.
distrc.2 $e |- A : be $.
distrc.3 $e |- B : al $.
$( Distribution of combination over substitution. $)
distrc $p |- T. |= [ ( \ x : al . ( F A ) B ) =
( ( \ x : al . F B ) ( \ x : al . A B ) ) ] $=
( kc kl ke kt weq wc wl ht ax-distrc dfov2 ) CCADGEKZLZFKADGLZFKZADELZFKZ
KMNCOACUBFACDUABCGEHIPQJPBCUDUFABCRZUCFAUGDGHQJPABUEFABDEIQJPPABCDEFGIJHS
T $.
$( [8-Oct-2014] $)
$}
${
$d x y $. $d y B $.
distrl.1 $e |- A : ga $.
distrl.2 $e |- B : al $.
$( Distribution of lambda abstraction over substitution. $)
distrl $p |- T. |=
[ ( \ x : al . \ y : be . A B ) = \ y : be . ( \ x : al . A B ) ] $=
( ht kl kc ke kt weq wl wc ax-distrl dfov2 ) BCJZTADBEFKZKZGLBEADFKZGLZKM
NTOATUBGATDUABCEFHPPIQBCEUDACUCGACDFHPIQPABCDEFGHIRS $.
$( [8-Oct-2014] $)
$}
${
eqtri.1 $e |- A : al $.
eqtri.2 $e |- R |= [ A = B ] $.
eqtri.3 $e |- R |= [ B = C ] $.
$( Transitivity of equality. $)
eqtri $p |- R |= [ A = C ] $=
( ke weq eqtypi kc dfov1 hb ht wc ceq2 mpbi dfov2 ) AABDIEAJZFACDEABCEFGK
ZHKIBLZCLUBDLEAABCIETFUAGMANCDUBEAANOIBTFPUAHQRS $.
$( [7-Oct-2014] $)
$}
${
3eqtr4i.1 $e |- A : al $.
3eqtr4i.2 $e |- R |= [ A = B ] $.
${
3eqtr4i.3 $e |- R |= [ S = A ] $.
3eqtr4i.4 $e |- R |= [ T = B ] $.
$( Transitivity of equality. $)
3eqtr4i $p |- R |= [ S = T ] $=
( eqtypri eqtypi eqcomi eqtri ) AEBFDABEDGIKIABCFDGHAFCDACFDABCDGHLJKJMNN
$.
$( [7-Oct-2014] $)
$}
3eqtr3i.3 $e |- R |= [ A = S ] $.
3eqtr3i.4 $e |- R |= [ B = T ] $.
$( Transitivity of equality. $)
3eqtr3i $p |- R |= [ S = T ] $=
( eqcomi eqtypi 3eqtr4i ) ABCDEFGHABEDGIKACFDABCDGHLJKM $.
$( [7-Oct-2014] $)
$}
${
oveq.1 $e |- F : ( al -> ( be -> ga ) ) $.
oveq.2 $e |- A : al $.
oveq.3 $e |- B : be $.
${
oveq123.4 $e |- R |= [ F = S ] $.
oveq123.5 $e |- R |= [ A = C ] $.
oveq123.6 $e |- R |= [ B = T ] $.
$( Equality theorem for binary operation. $)
oveq123 $p |- R |= [ [ A F B ] = [ C S T ] ] $=
( kc kbr wc ke ht ceq12 weq wov ax-cb1 df-ov a1i dfov2 eqtypi 3eqtr4i )
CGDQZEQZIFQZJQZHDEGRZFJIRZBCUKEABCUAZGDKLSZMSZBCEJUKHUMURMAUQDFGHIKLNOU
BPUBCCUOULTHCUCZABCDEGKLMUDUSTUOQULQHGITRHNUEZABCDEGKLMUFUGUHCCUPUNTHUT
ABCFJIAUQUAGIHKNUIZADFHLOUIZBEJHMPUIZUDBCUMJAUQIFVBVCSVDSTUPQUNQHVAABCF
JIVBVCVDUFUGUHUJ $.
$( [7-Oct-2014] $)
$}
${
oveq1.4 $e |- R |= [ A = C ] $.
$( Equality theorem for binary operation. $)
oveq1 $p |- R |= [ [ A F B ] = [ C F B ] ] $=
( ht ke kbr ax-cb1 eqid oveq123 ) ABCDEFGHGEIJKABCMMGHDFNOHLPZIQLBEHSKQ
R $.
$( [7-Oct-2014] $)
oveq12.5 $e |- R |= [ B = T ] $.
$( Equality theorem for binary operation. $)
oveq12 $p |- R |= [ [ A F B ] = [ C F T ] ] $=
( ht ke kbr ax-cb1 eqid oveq123 ) ABCDEFGHGIJKLABCOOGHDFPQHMRJSMNT $.
$( [7-Oct-2014] $)
$}
${
oveq2.4 $e |- R |= [ B = T ] $.
$( Equality theorem for binary operation. $)
oveq2 $p |- R |= [ [ A F B ] = [ A F T ] ] $=
( ke kbr ax-cb1 eqid oveq12 ) ABCDEDFGHIJKADGEHMNGLOJPLQ $.
$( [7-Oct-2014] $)
$}
${
oveq.4 $e |- R |= [ F = S ] $.
$( Equality theorem for binary operation. $)
oveq $p |- R |= [ [ A F B ] = [ A S B ] ] $=
( ke kbr ax-cb1 eqid oveq123 ) ABCDEDFGHEIJKLADGFHMNGLOZJPBEGRKPQ $.
$( [7-Oct-2014] $)
$}
$}
${
ax-hbl1.1 $e |- A : ga $.
ax-hbl1.2 $e |- B : al $.
$( ` x ` is bound in ` \ x A ` . $)
ax-hbl1 $a |- T. |= [ ( \ x : al . \ x : be . A B ) = \ x : be . A ] $.
hbl1.3 $e |- R : bool $.
$( Inference form of ~ ax-hbl1 . $)
hbl1 $p |- R |= [ ( \ x : al . \ x : be . A B ) = \ x : be . A ] $=
( kl kc ke kbr ax-hbl1 a1i ) ADBDEKZKFLQMNGJABCDEFHIOP $.
$( [8-Oct-2014] $)
$}
${
$d x A $.
ax-17.1 $e |- A : be $.
ax-17.2 $e |- B : al $.
$( If ` x ` does not appear in ` A ` , then any substitution to ` A `
yields ` A ` again, i.e. ` \ x A ` is a constant function. $)
ax-17 $a |- T. |= [ ( \ x : al . A B ) = A ] $.
a17i.3 $e |- R : bool $.
$( Inference form of ~ ax-17 . $)
a17i $p |- R |= [ ( \ x : al . A B ) = A ] $=
( kl kc ke kbr ax-17 a1i ) ACDJEKDLMFIABCDEGHNO $.
$( [8-Oct-2014] $)
$}
${
$d x R $.
hbxfr.1 $e |- T : be $.
hbxfr.2 $e |- B : al $.
${
hbxfrf.3 $e |- R |= [ T = A ] $.
hbxfrf.4 $e |- ( S , R ) |= [ ( \ x : al . A B ) = A ] $.
$( Transfer a hypothesis builder to an equivalent expression. $)
hbxfrf $p |- ( S , R ) |= [ ( \ x : al . T B ) = T ] $=
( kl kc kct eqtypi wl ke kbr adantl wc leq ceq1 ax-cb1 wctl 3eqtr4i ) B
ACDMZENZDGFOZACHMZENZHABUGEABCDBHDFIKPQJUALFGUKUHRSABEUJFUGABCHIQJABCHD
FIKUBUCGFUHDRSUILUDUEZTFGHDRSKULTUF $.
$( [8-Oct-2014] $)
$}
hbxfr.3 $e |- R |= [ T = A ] $.
hbxfr.4 $e |- R |= [ ( \ x : al . A B ) = A ] $.
$( Transfer a hypothesis builder to an equivalent expression. $)
hbxfr $p |- R |= [ ( \ x : al . T B ) = T ] $=
( kl kc ke kbr ax-cb1 id adantr hbxfrf syl2anc ) ACGLEMGNOFFFFGDNOFJPZQZU
BABCDEFFGHIJFFACDLEMDNOKUARST $.
$( [8-Oct-2014] $)
$}
${
$d x R $.
hbth.1 $e |- B : al $.
hbth.2 $e |- R |= A $.
$( Hypothesis builder for a theorem. $)
hbth $p |- R |= [ ( \ x : al . A B ) = A ] $=
( hb kt ax-cb2 wtru eqtru eqcomi ax-cb1 a17i hbxfr ) AHBIDECCEGJFHICEKCEG
LMAHBIDEKFCEGNOP $.
$( [8-Oct-2014] $)
$}
${
hbc.1 $e |- F : ( be -> ga ) $.
hbc.2 $e |- A : be $.
hbc.3 $e |- B : al $.
hbc.4 $e |- R |= [ ( \ x : al . F B ) = F ] $.
hbc.5 $e |- R |= [ ( \ x : al . A B ) = A ] $.
$( Hypothesis builder for combination. $)
hbc $p |- R |= [ ( \ x : al . ( F A ) B ) = ( F A ) ] $=
( kc kl wc wl ke kbr ax-cb1 distrc a1i ht eqtypri ceq12 eqtri ) CADGENZOZ
FNZADGOZFNZADEOFNZNZUGHACUHFACDUGBCGEIJPQKPUIUMRSHUKGRSHLTABCDEFGIJKUAUBB
CULEUKHGABCUCZUJFAUNDGIQKPBEULHJMUDLMUEUF $.
$( [8-Oct-2014] $)
$}
${
hbov.1 $e |- F : ( be -> ( ga -> de ) ) $.
hbov.2 $e |- A : be $.
hbov.3 $e |- B : al $.
hbov.4 $e |- C : ga $.
hbov.5 $e |- R |= [ ( \ x : al . F B ) = F ] $.
hbov.6 $e |- R |= [ ( \ x : al . A B ) = A ] $.
hbov.7 $e |- R |= [ ( \ x : al . C B ) = C ] $.
$( Hypothesis builder for binary operation. $)
hbov $p |- R |= [ ( \ x : al . [ A F C ] B ) = [ A F C ] ] $=
( kt kbr kc kl ke ax-cb1 trud wov weq ht wc df-ov dfov2 hbc adantr hbxfrf
wtru mpdan ) JRAEFHISZUAGTUPUBSJAEIUAGTIUBSJOUCUDADEIFTZHTZGRJUPBCDFHIKLN
UEZMDDUPURUBRDUFUSCDUQHBCDUGZIFKLUHZNUHBCDFHIKLNUIUJJRAEURUAGTURUBSACDEHG
UQJVANMABUTEFGIJKLMOPUKQUKUNULUMUO $.
$( [8-Oct-2014] $)
$}
${
$d x y $. $d y B $. $d y R $.
hbl.1 $e |- A : ga $.
hbl.2 $e |- B : al $.
hbl.3 $e |- R |= [ ( \ x : al . A B ) = A ] $.
$( Hypothesis builder for lambda abstraction. $)
hbl $p |- R |= [ ( \ x : al . \ y : be . A B ) = \ y : be . A ] $=
( ht kl kc wl wc ke kbr ax-cb1 distrl a1i leq eqtri ) BCLZADBEFMZMZGNZBEA
DFMZGNZMZUEHAUDUFGAUDDUEBCEFIOOJPUGUJQRHUIFQRHKSABCDEFGIJTUABCEUIFHACUHGA
CDFIOJPKUBUC $.
$( [8-Oct-2014] $)
$}
${
$d x y $. $d y B $. $d y S $.
ax-inst.1 $e |- R |= A $.
ax-inst.2 $e |- T. |= [ ( \ x : al . B y : al ) = B ] $.
ax-inst.3 $e |- T. |= [ ( \ x : al . S y : al ) = S ] $.
ax-inst.4 $e |- [ x : al = C ] |= [ A = B ] $.
ax-inst.5 $e |- [ x : al = C ] |= [ R = S ] $.
$( Instantiate a theorem with a new term. The second and third hypotheses
are the HOL equivalent of set.mm "effectively not free in" predicate
(see set.mm's ax-17, or ~ ax17 ). $)
ax-inst $a |- S |= B $.
$}
${
$d x y R $. $d y B $.
insti.1 $e |- C : al $.
insti.2 $e |- B : bool $.
insti.3 $e |- R |= A $.
insti.4 $e |- T. |= [ ( \ x : al . B y : al ) = B ] $.
insti.5 $e |- [ x : al = C ] |= [ A = B ] $.
$( Instantiate a theorem with a new term. $)
insti $p |- R |= B $=
( hb tv ax-cb1 wv ax-17 ke kbr eqid ax-inst ) ABCDEFGGJKAMBGACNDGJOZACPQL
MGABNFRSZDERSUCLOUBTUA $.
$( [8-Oct-2014] $)
$}
${
$d y A $. $d y B $. $d y C $. $d x y al $.
clf.1 $e |- A : be $.
clf.2 $e |- C : al $.
clf.3 $e |- [ x : al = C ] |= [ A = B ] $.
clf.4 $e |- T. |= [ ( \ x : al . B y : al ) = B ] $.
clf.5 $e |- T. |= [ ( \ x : al . C y : al ) = C ] $.
$( Evaluate a lambda expression. $)
clf $p |- T. |= [ ( \ x : al . A C ) = B ] $=
( kl tv kc ke kbr kt wc hb wl eqtypi weqi ax-cb1 beta a1i wv ht a17i hbl1
weq hbc hbov id ceq2 oveq12 insti ) ACDACEMZACNZOZEPQZURGOZFPQGRIBVBFABUR
GABCEHUAZISZBEFUSGPQZHJUBZUCVARACFMADNZOFPQRKUDZABCEHUEUFABBTCVBVGFPRBUKZ
VDADUGZVFABBTUHUHCPVGRVIVJVHUIAABCGVGURRVCIVJAABCEVGRHVJVHUJLULKUMBBTUTEV
BPVEFVIABURUSVCACUGZSHABUSGURVEVCVKVEAUSGVKIUCUNUOJUPUQ $.
$( [8-Oct-2014] $)
$}
${
$d y A $. $d x y B $. $d x y C $. $d x y al $.
cl.1 $e |- A : be $.
cl.2 $e |- C : al $.
cl.3 $e |- [ x : al = C ] |= [ A = B ] $.
$( Evaluate a lambda expression. $)
cl $p |- T. |= [ ( \ x : al . A C ) = B ] $=
( vy tv ke kbr eqtypi wv ax-17 clf ) ABCJDEFGHIABCEAJKZBDEACKFLMGINAJOZPA
ACFRHSPQ $.
$( [8-Oct-2014] $)
$}
${
$d x B $. $d y C $. $d x y S $. $d y T $. $d x al $. $d y be $.
ovl.1 $e |- A : ga $.
ovl.2 $e |- S : al $.
ovl.3 $e |- T : be $.
ovl.4 $e |- [ x : al = S ] |= [ A = B ] $.
ovl.5 $e |- [ y : be = T ] |= [ B = C ] $.
$( Evaluate a lambda expression in a binary operation. $)
ovl $p |- T. |= [ [ S \ x : al . \ y : be . A T ] = C ] $=
( kl kbr kc kt ke ht wl wov weq wc wtru df-ov a1i dfov2 distrl ceq1 eqtri
tv wv weqi cl ) CIJADBEFPZPZQZBEADFPZIRZPZJRZHSABCIJURABCUAZDUQBCEFKUBUBZ
LMUCZCUSURIRZJRZVCSVFCCUSVHTSCUDVFBCVGJAVDURIVELUEZMUETUSRVHRSUFABCIJURVE
LMUGUHUIBCJVGSVBVIMVGVBTQSUFABCDEFIKLUJUHUKULBCEVAHJACUTIACDFKUBLUEZMCVAG
HBEUMZJTQZVJVAGTQVLBVKJBEUNMUOACDFGIKLNUPUHOULUPUL $.
$( [8-Oct-2014] $)
$}
$(
#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
Add propositional calculus definitions
#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
$)
$c F. $. $( Contradiction term $)
$c /\ $. $( Conjunction term $)
$c ~ $. $( Negation term $)
$c ==> $. $( Implication term $)
$c ! $. $( For all term $)
$c ? $. $( There exists term $)
$c \/ $. $( Disjunction term $)
$c ?! $. $( There exists unique term $)
$( Contradiction term. $)
tfal $a term F. $.
$( Conjunction term. $)
tan $a term /\ $.
$( Negation term. $)
tne $a term ~ $.
$( Implication term. $)
tim $a term ==> $.
$( For all term. $)
tal $a term ! $.
$( There exists term. $)
tex $a term ? $.
$( Disjunction term. $)
tor $a term \/ $.
$( There exists unique term. $)
teu $a term ?! $.
${
$d f p q x y $.
$( Define the for all operator. $)
df-al $a |- T. |=
[ ! = \ p : ( al -> bool ) . [ p : ( al -> bool ) = \ x : al . T. ] ] $.
$( Define the constant false. $)
df-fal $a |- T. |= [ F. = ( ! \ p : bool . p : bool ) ] $.
$( Define the 'and' operator. $)
df-an $a |- T. |=
[ /\ = \ p : bool . \ q : bool . [ \ f : ( bool -> ( bool -> bool ) ) .
[ p : bool f : ( bool -> ( bool -> bool ) ) q : bool ] =
\ f : ( bool -> ( bool -> bool ) ) .
[ T. f : ( bool -> ( bool -> bool ) ) T. ] ] ] $.
$( Define the implication operator. $)
df-im $a |- T. |= [ ==> =
\ p : bool . \ q : bool . [ [ p : bool /\ q : bool ] = p : bool ] ] $.
$( Define the negation operator. $)
df-not $a |- T. |= [ ~ = \ p : bool . [ p : bool ==> F. ] ] $.
$( Define the existence operator. $)
df-ex $a |- T. |= [ ? = \ p : ( al -> bool ) . ( ! \ q : bool . [ ( ! \ x : al .
[ ( p : ( al -> bool ) x : al ) ==> q : bool ] ) ==> q : bool ] ) ] $.
$( Define the 'or' operator. $)
df-or $a |- T. |= [ \/ = \ p : bool . \ q : bool . ( ! \ x : bool .
[ [ p : bool ==> x : bool ] ==>
[ [ q : bool ==> x : bool ] ==> x : bool ] ] ) ] $.
$( Define the 'exists unique' operator. $)
df-eu $a |- T. |= [ ?! = \ p : ( al -> bool ) . ( ? \ y : al . ( ! \ x : al .
[ ( p : ( al -> bool ) x : al ) = [ x : al = y : al ] ] ) ) ] $.
$}
${