-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAOT_NaturalNumbers.thy
More file actions
7987 lines (7629 loc) · 499 KB
/
AOT_NaturalNumbers.thy
File metadata and controls
7987 lines (7629 loc) · 499 KB
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
(*<*)
theory AOT_NaturalNumbers
imports AOT_PossibleWorlds AOT_RestrictedVariables
abbrevs one-to-one = \<open>\<^sub>1\<^sub>-\<^sub>1\<close>
and onto = \<open>\<^sub>o\<^sub>n\<^sub>t\<^sub>o\<close>
begin
(*>*)
(* TODO: move to right place (274) *)
AOT_theorem "discern-obj:1": \<open>[\<lambda>x \<box>\<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))]\<down>\<close>
proof(safe intro!: "kirchner-thm:1"[THEN "\<equiv>E"(2)] RN GEN "\<rightarrow>I")
AOT_modally_strict {
fix x y
AOT_assume 0: \<open>\<forall>F ([F]x \<equiv> [F]y)\<close>
AOT_hence 1: \<open>\<box>\<forall>F ([F]x \<equiv> [F]y)\<close>
using "\<rightarrow>E" "ind-nec" by blast
AOT_assume aux: \<open>\<box>\<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))\<close>
moreover {
AOT_assume Ox: \<open>O!x\<close>
AOT_hence Oy: \<open>O!y\<close>
using 0 "\<equiv>E"(1) "\<forall>E"(1) "oa-exist:1" by blast
AOT_hence \<open>x = y\<close>
using 1 Ox "identity:1"[THEN "\<equiv>\<^sub>d\<^sub>fI"]
using "con-dis-i-e:3:a" "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E" by presburger
AOT_hence \<open>\<box>\<forall>z(z \<noteq> y \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]y))\<close>
using aux "rule=E" by fast
}
moreover {
AOT_assume 2: \<open>A!x\<close>
AOT_have Ay: \<open>A!y\<close> using 0
using "2" "cqt-basic:6.\<equiv>E(2).\<forall>E(1).\<forall>E(1)" "intro-elim:3:a" "oa-exist:2" by blast
AOT_hence \<open>\<box>A!y\<close> by (metis "oa-facts:2" "vdash-properties:10")
moreover AOT_have \<open>\<box>A!x\<close>
using "2" "oa-facts:2.unvarify_x.\<forall>E(1).\<rightarrow>E" "russell-axiom[exe,1].\<psi>_denotes_asm" by auto
ultimately AOT_have 3: \<open>\<box>(A!x & A!y & \<forall>F ([F]x \<equiv> [F]y) & \<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x)))\<close>
using "1" "KBasic:3.\<equiv>E(2)" "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E" aux by presburger
AOT_have \<open>\<box>(A!x & A!y & \<forall>F ([F]x \<equiv> [F]y) & \<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))) \<rightarrow> \<box>\<forall>z(z \<noteq> y \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]y))\<close>
proof (rule RM; safe intro!: "\<rightarrow>I")
AOT_modally_strict {
AOT_assume A: \<open>A!x & A!y & \<forall>F ([F]x \<equiv> [F]y) & \<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))\<close>
AOT_show \<open>\<forall>z(z \<noteq> y \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]y))\<close>
proof(safe intro!: GEN "\<rightarrow>I")
fix z
AOT_assume z_not_y: \<open>z \<noteq> y\<close>
AOT_show \<open>\<exists>F \<not>([F]z \<equiv> [F]y)\<close>
proof(rule "raa-cor:1")
AOT_assume \<open>\<not>\<exists>F \<not>([F]z \<equiv> [F]y)\<close>
AOT_hence B: \<open>\<forall>F ([F]z \<equiv> [F]y)\<close>
by (metis "cqt-further:3" "intro-elim:3:b")
AOT_have C: \<open>\<forall>F ([F]z \<equiv> [F]x)\<close>
proof(rule GEN)
fix F
AOT_have \<open>[F]z \<equiv> [F]y\<close> using B[THEN "\<forall>E"(2)] by simp
also AOT_have \<open>\<dots> \<equiv> [F]x\<close> using A[THEN "&E"(1), THEN "&E"(2), THEN "\<forall>E"(2)]
by (metis "Commutativity of \<equiv>" "intro-elim:3:b")
finally AOT_show \<open>[F]z \<equiv> [F]x\<close>.
qed
AOT_have \<open>z = x\<close>
proof(rule "raa-cor:1")
AOT_assume \<open>\<not>(z = x)\<close>
AOT_hence \<open>z \<noteq> x\<close> by (metis "=-infix" "\<equiv>\<^sub>d\<^sub>fI")
AOT_hence \<open>\<exists>F \<not>([F]z \<equiv> [F]x)\<close>
using A[THEN "&E"(2), THEN "\<forall>E"(2), THEN "\<rightarrow>E"] by blast
then AOT_obtain F where \<open>\<not>([F]z \<equiv> [F]x)\<close> using "\<exists>E"[rotated] by blast
AOT_thus \<open>p & \<not>p\<close> for p using C[THEN "\<forall>E"(2)] by (metis "reductio-aa:1")
qed
AOT_hence \<open>x \<noteq> y\<close>
using z_not_y "rule=E" by fast
AOT_hence \<open>y \<noteq> x\<close> by (metis "=-infix" "\<equiv>\<^sub>d\<^sub>fE" "\<equiv>\<^sub>d\<^sub>fI" "reductio-aa:1" id_sym)
AOT_hence \<open>\<exists>F \<not>([F]y \<equiv> [F]x)\<close>
using A[THEN "&E"(2)] "\<forall>E"(2) "\<rightarrow>E" by blast
then AOT_obtain F where \<open>\<not>([F]y \<equiv> [F]x)\<close>
using "\<exists>E"[rotated] by blast
moreover {
AOT_have \<open>[F]x \<equiv> [F]y\<close> using A[THEN "&E"(1), THEN "&E"(2), THEN "\<forall>E"(2)] by blast
AOT_hence \<open>[F]y \<equiv> [F]x\<close> by (metis "intro-elim:3:f" "oth-class-taut:3:a")
}
ultimately AOT_show \<open>p & \<not>p\<close> for p by (metis "reductio-aa:1")
qed
qed
}
qed
AOT_hence \<open>\<box>\<forall>z(z \<noteq> y \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]y))\<close>
using 3 "\<rightarrow>E" by blast
}
ultimately AOT_have \<open>\<box>\<forall>z(z \<noteq> y \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]y))\<close>
using "con-dis-i-e:4:a" "deduction-theorem" "oa-exist:3" by blast
} note impl = this
AOT_modally_strict {
fix x y
AOT_assume 0: \<open>\<forall>F ([F]x \<equiv> [F]y)\<close>
AOT_hence 1: \<open>\<forall>F ([F]y \<equiv> [F]x)\<close>
by (metis "cqt-basic:11" "intro-elim:3:b")
AOT_show \<open>\<box>\<forall>z(z \<noteq> x \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]x)) \<equiv> \<box>\<forall>z(z \<noteq> y \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]y))\<close>
proof(safe intro!: "\<equiv>I" "\<rightarrow>I")
AOT_assume \<open>\<box>\<forall>z(z \<noteq> x \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]x))\<close>
AOT_thus \<open>\<box>\<forall>z(z \<noteq> y \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]y))\<close> using impl 0 by blast
next
AOT_assume \<open>\<box>\<forall>z(z \<noteq> y \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]y))\<close>
AOT_thus \<open>\<box>\<forall>z(z \<noteq> x \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]x))\<close> using impl 1 by blast
qed
}
qed
AOT_define Discernible :: \<open>\<Pi>\<close> (\<open>D!\<close>)
"discern-obj:2": \<open>D! =\<^sub>d\<^sub>f [\<lambda>x \<box>\<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))]\<close>
AOT_theorem "discern-obj:2[undef]": \<open>D! = [\<lambda>x \<box>\<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))]\<close>
using "rule-id-df:1[zero]"[OF "discern-obj:2", OF "discern-obj:1"].
AOT_theorem Discernible_den: \<open>D!\<down>\<close>
using "discern-obj:2[undef]" "t=t-proper:1" "vdash-properties:10" by blast
AOT_theorem "discern-obj:3": \<open>D!x \<equiv> \<forall>z(z \<noteq> x \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]x))\<close>
proof(safe intro!: "\<equiv>I" "\<rightarrow>I")
AOT_assume \<open>D!x\<close>
moreover AOT_have \<open>[\<lambda>x \<box>\<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))]x \<equiv> \<box>\<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))\<close>
using "beta-C-meta"[THEN "\<rightarrow>E"] "discern-obj:1" by fast
ultimately AOT_have \<open>\<box>\<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))\<close>
using "discern-obj:2[undef].rule=E'" "intro-elim:3:a" by fastforce
AOT_thus \<open>\<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))\<close>
by (meson "B\<diamond>" "T\<diamond>" "vdash-properties:10")
next
AOT_assume 0: \<open>\<forall>z(z \<noteq> x \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]x))\<close>
AOT_modally_strict {
fix z x
AOT_have \<open>(z \<noteq> x \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]x)) \<equiv> (\<exists>F \<not>([F]z \<equiv> [F]x) \<or> z = x)\<close>
by (smt (verit) "=-infix" "\<equiv>\<^sub>d\<^sub>fE" "\<equiv>\<^sub>d\<^sub>fI" "con-dis-i-e:3:a" "con-dis-i-e:3:b" "con-dis-i-e:4:c" "deduction-theorem"
"intro-elim:2" "reductio-aa:2" "vdash-properties:6")
also AOT_have \<open>(\<exists>F \<not>([F]z \<equiv> [F]x) \<or> z = x) \<equiv> (\<not>\<forall>F ([F]z \<equiv> [F]x) \<or> z = x)\<close>
by (metis (mono_tags, lifting) "con-dis-i-e:3:a" "con-dis-i-e:3:b" "con-dis-i-e:4:b" "cqt-further:2.\<rightarrow>E.\<exists>E'" "deduction-theorem"
"existential:2[const_var]" "instantiation" "intro-elim:2" "raa-cor:1" "rule-ui:3")
also AOT_have \<open>(\<not>\<forall>F ([F]z \<equiv> [F]x) \<or> z = x) \<equiv> (\<forall>F ([F]z \<equiv> [F]x) \<rightarrow> z = x)\<close>
using "intro-elim:3:f" "oth-class-taut:1:c" "oth-class-taut:3:a" by blast
finally AOT_have \<open>(z \<noteq> x \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]x)) \<equiv> (\<forall>F([F]z \<equiv> [F]x) \<rightarrow> z = x)\<close>.
} note 1 = this
{
fix z
AOT_have \<open>z \<noteq> x \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]x)\<close>
using 0 "rule-ui:3" by blast
AOT_hence \<open>\<forall>F([F]z \<equiv> [F]x) \<rightarrow> z = x\<close>
using 1
by (metis (no_types, lifting) ext "=-infix" "\<equiv>\<^sub>d\<^sub>fI" "deduction-theorem" "instantiation" "reductio-aa:1" "rule-ui:3"
"vdash-properties:10")
moreover AOT_have \<open>\<box>(\<forall>F([F]z \<equiv> [F]x) \<rightarrow> \<box>\<forall>F([F]z \<equiv> [F]x))\<close>
by (simp add: "ind-nec" RN)
moreover AOT_have \<open>\<box>(z = x \<rightarrow> \<box>z = x)\<close>
by (simp add: "id-nec:1" RN)
ultimately AOT_have \<open>\<box>(\<forall>F([F]z \<equiv> [F]x) \<rightarrow> z = x)\<close>
using "Hypothetical Syllogism" "S5Basic:4.\<rightarrow>E" "T-S5-fund:1.\<rightarrow>E" "sc-eq-box-box:6.\<rightarrow>E.\<rightarrow>E" by blast
AOT_hence \<open>\<box>(z \<noteq> x \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]x))\<close>
by (AOT_subst \<open>z \<noteq> x \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]x)\<close> \<open>\<forall>F([F]z \<equiv> [F]x) \<rightarrow> z = x\<close>)
(auto simp add: "1")
}
AOT_hence \<open>\<forall>y\<box>(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))\<close>
by (rule GEN)
AOT_hence \<open>\<box>\<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))\<close>
by (simp add: "BFs:1.\<rightarrow>E")
AOT_hence \<open>[\<lambda>x \<box>\<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))]x\<close>
by (simp add: "beta-C-cor:2.\<rightarrow>E.\<forall>E(1).\<equiv>E(2)" "cqt:2"(1) "discern-obj:1")
AOT_thus \<open>D!x\<close>
using "rule=E" "discern-obj:2[undef]" id_sym by fast
qed
AOT_theorem "discern-obj:4": \<open>O!x \<rightarrow> D!x\<close>
proof(rule "\<rightarrow>I")
AOT_assume Ox: \<open>O!x\<close>
AOT_have \<open>\<forall>z(z \<noteq> x \<rightarrow> \<exists>F \<not>([F]z \<equiv> [F]x))\<close>
proof(rule GEN; rule "contraposition:1[2]"; rule "\<rightarrow>I")
fix z
AOT_assume \<open>\<not>\<exists>F \<not>([F]z \<equiv> [F]x)\<close>
AOT_hence indist: \<open>\<forall>F([F]z \<equiv> [F]x)\<close>
using "cqt-further:3" "intro-elim:3:b" by blast
AOT_hence \<open>O!z\<close>
using "intro-elim:3:b" "oa-exist:1" "rule-ui:1" Ox by blast
AOT_hence \<open>z = x\<close>
using "ord=E:2"[THEN "\<rightarrow>E", THEN "\<rightarrow>E"]
by (simp add: "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E" Ox indist)
AOT_thus \<open>\<not>(z \<noteq> x)\<close>
using "=-infix" "df-rules-formulas[3]" "useful-tautologies:6.\<rightarrow>E.\<rightarrow>E" by blast
qed
AOT_thus \<open>D!x\<close>
using "cqt:2"(1) "discern-obj:3.unvarify_x.\<forall>E(1).\<equiv>E(2)" by blast
qed
AOT_theorem "discern-obj:5": \<open>\<exists>x D!x\<close>
by (metis "S5Basic:4.\<rightarrow>E" "T-S5-fund:1.\<rightarrow>E" "discern-obj:4.unvarify_x.\<forall>E(1).\<rightarrow>E" "existential:2[const_var]" "instantiation"
"o-objects-exist:1" "russell-axiom[exe,1].\<psi>_denotes_asm")
AOT_theorem "discern-obj:6": \<open>\<exists>x(A!x & \<not>D!x)\<close>
proof -
AOT_obtain x y where xy: \<open>A!x & A!y & x \<noteq> y & \<forall>F ([F]x \<equiv> [F]y)\<close>
using "aclassical2" "\<exists>E"[rotated] by blast
moreover AOT_have \<open>\<not>D!y\<close>
proof(rule "raa-cor:2")
AOT_assume \<open>D!y\<close>
AOT_hence \<open>x \<noteq> y \<rightarrow> \<exists>F \<not>([F]x \<equiv> [F]y)\<close>
using "cqt:2"(1) "discern-obj:3" "intro-elim:3:a" "rule-ui:1" by blast
AOT_hence \<open>\<exists>F \<not>([F]x \<equiv> [F]y)\<close>
using "con-dis-i-e:2:a" "con-dis-i-e:2:b" "vdash-properties:10" xy by blast
AOT_thus \<open>p & \<not>p\<close> for p
using "con-dis-i-e:2:b" "cqt-further:3.\<equiv>E(1)" "raa-cor:4" xy by blast
qed
ultimately AOT_have \<open>A!y & \<not>D!y\<close>
by (meson "con-dis-i-e:2:a" "con-dis-i-e:2:b" "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E")
AOT_thus \<open>\<exists>x(A!x & \<not>D!x)\<close>
using "\<exists>I" by fast
qed
AOT_theorem "discern-obj:7": \<open>(D!x \<or> D!y) \<rightarrow> (\<forall>F([F]x \<equiv> [F]y) \<rightarrow> x = y)\<close>
proof(safe intro!: "\<rightarrow>I"; rule "raa-cor:1")
AOT_assume \<open>D!x \<or> D!y\<close>
moreover AOT_assume indist: \<open>\<forall>F ([F]x \<equiv> [F]y)\<close>
ultimately AOT_have \<open>D!y\<close>
using "con-dis-i-e:4:b" "intro-elim:3:a" "raa-cor:1" "rule-ui:1" Discernible_den by blast
AOT_hence \<open>x \<noteq> y \<rightarrow> \<exists>F \<not>([F]x \<equiv> [F]y)\<close>
by (meson "cqt:2"(1) "deduction-theorem" "discern-obj:3.unvarify_x.\<forall>E(1).\<equiv>E(1).\<forall>E(1).\<rightarrow>E.\<exists>E'" "existential:1")
moreover AOT_assume \<open>\<not>(x = y)\<close>
ultimately AOT_have \<open>\<exists>F \<not>([F]x \<equiv> [F]y)\<close>
using "=-infix" "\<equiv>\<^sub>d\<^sub>fI" "vdash-properties:10" by blast
AOT_thus \<open>p & \<not>p\<close> for p
using "cqt-further:3.\<equiv>E(1)" "raa-cor:4" indist by blast
qed
(* Note: added to improve automation *)
AOT_theorem "discern-obj:7[1]": \<open>D!x \<rightarrow> (\<forall>F([F]x \<equiv> [F]y) \<rightarrow> x = y)\<close>
using "Hypothetical Syllogism" "con-dis-taut:3" "discern-obj:7" by blast
AOT_theorem "discern-obj:7[2]": \<open>D!y \<rightarrow> (\<forall>F([F]x \<equiv> [F]y) \<rightarrow> x = y)\<close>
using "Hypothetical Syllogism" "con-dis-taut:4" "discern-obj:7" by blast
AOT_theorem "discern-obj:8": \<open>D!x \<rightarrow> \<box>D!x\<close>
proof (rule "\<rightarrow>I")
AOT_assume \<open>D!x\<close>
AOT_hence \<open>[\<lambda>x \<box>\<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))]x\<close>
using "discern-obj:2[undef].rule=E'" by fastforce
AOT_hence \<open>\<box>\<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))\<close>
using "betaC:1:a" by auto
AOT_hence \<open>\<box>\<box>\<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))\<close>
by (simp add: "S5Basic:5.\<rightarrow>E")
AOT_hence \<open>\<box>[\<lambda>x \<box>\<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))]x\<close>
apply (AOT_subst \<open>[\<lambda>x \<box>\<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))]x\<close> \<open>\<box>\<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))\<close>)
apply (metis (no_types, lifting) ext "betaC:1:a" "betaC:2:a" "cqt:2"(1) "deduction-theorem" "discern-obj:1" "intro-elim:2")
by simp
AOT_thus \<open>\<box>D!x\<close>
apply (AOT_subst \<open>D!x\<close> \<open>[\<lambda>x \<box>\<forall>y(y \<noteq> x \<rightarrow> \<exists>F \<not>([F]y \<equiv> [F]x))]x\<close>)
using "discern-obj:2[undef].rule=E'" "oth-class-taut:3:a" by fast+
qed
AOT_theorem "discern-obj:9": \<open>D!x \<equiv> \<box>D!x\<close>
by (simp add: "discern-obj:8" "intro-elim:2" "qml:2" "vdash-properties:1[2]")
AOT_theorem "discern-obj:10": \<open>\<diamond>D!x \<equiv> D!x\<close>
by (meson "Commutativity of \<equiv>" "RE\<diamond>" "S5Basic:2" "discern-obj:9" "intro-elim:3:a" "intro-elim:3:e")
AOT_theorem "discern-obj:11": \<open>\<diamond>D!x \<equiv> \<box>D!x\<close>
using "discern-obj:10" "discern-obj:9" "intro-elim:3:e" by blast
AOT_theorem "discern-obj:12": \<open>D!x \<equiv> \<^bold>\<A>D!x\<close>
by (metis "Act-Sub:3" "cqt:2"(1) "deduction-theorem" "discern-obj:10.unvarify_x.\<forall>E(1).\<equiv>E(1)" "discern-obj:9" "intro-elim:2"
"intro-elim:3:a" "nec-imp-act")
AOT_theorem "discern-obj:13": \<open>[\<lambda>x D!x & \<phi>{x}]\<down>\<close>
proof(safe intro!: "kirchner-thm:1"[THEN "\<equiv>E"(2)] RN GEN "\<rightarrow>I")
AOT_modally_strict {
fix x y
AOT_assume indist: \<open>\<forall>F ([F]x \<equiv> [F]y)\<close>
AOT_show \<open>(D!x & \<phi>{x}) \<equiv> (D!y & \<phi>{y})\<close>
proof(safe intro!: "\<rightarrow>I" "\<equiv>I")
AOT_assume 0: \<open>D!x & \<phi>{x}\<close>
moreover AOT_have \<open>x = y\<close>
by (safe intro!: "discern-obj:7"[THEN "\<rightarrow>E", THEN "\<rightarrow>E"] 0[THEN "&E"(1)] "\<or>I"(1) indist)
ultimately AOT_show \<open>D!y & \<phi>{y}\<close>
using "rule=E" by fast
next
AOT_assume 0: \<open>D!y & \<phi>{y}\<close>
moreover AOT_have \<open>x = y\<close>
by (safe intro!: "discern-obj:7"[THEN "\<rightarrow>E", THEN "\<rightarrow>E"] 0[THEN "&E"(1)] "\<or>I"(2) indist)
ultimately AOT_show \<open>D!x & \<phi>{x}\<close>
using "rule=E" id_sym by fast
qed
}
qed
(* TODO: "discern-obj:14" "discern-obj:15" (general case) *)
AOT_theorem "discern-obj:15[2]": \<open>[\<lambda>xy D!x & D!y & \<phi>{x,y}]\<down>\<close>
proof(rule "safe-ext[2]"[axiom_inst, THEN "\<rightarrow>E"])
AOT_have \<open>\<box>\<forall>x \<forall>y (D!x & D!y & \<exists>x' \<exists>y' (\<forall>F([F]x \<equiv> [F]x') & \<forall>F([F]y \<equiv> [F]y') & \<phi>{x',y'}) \<equiv> D!x & D!y & \<phi>{x,y})\<close>
proof(safe intro!: "\<equiv>I" RN GEN "\<rightarrow>I")
AOT_modally_strict {
fix x y
AOT_assume 0: \<open>D!x & D!y & \<exists>x' \<exists>y' (\<forall>F([F]x \<equiv> [F]x') & \<forall>F([F]y \<equiv> [F]y') & \<phi>{x',y'})\<close>
then AOT_obtain x' where \<open>\<exists>y' (\<forall>F([F]x \<equiv> [F]x') & \<forall>F([F]y \<equiv> [F]y') & \<phi>{x',y'})\<close>
using "&E" "\<exists>E"[rotated] by blast
then AOT_obtain y' where 2: \<open>\<forall>F([F]x \<equiv> [F]x') & \<forall>F([F]y \<equiv> [F]y') & \<phi>{x',y'}\<close>
using "\<exists>E"[rotated] by blast
AOT_hence \<open>x = x'\<close>
using "discern-obj:7"[THEN "\<rightarrow>E", THEN "\<rightarrow>E", OF "\<or>I"(1)]
using "0" "con-dis-i-e:2:a" by blast
AOT_hence \<open>\<phi>{x,y'}\<close>
using 2[THEN "&E"(2)] "rule=E" "&E" 0
by (metis id_sym)
moreover AOT_have \<open>y = y'\<close>
using 2
using "discern-obj:7"[THEN "\<rightarrow>E", THEN "\<rightarrow>E", OF "\<or>I"(1)]
using "0" "con-dis-i-e:2:a" "con-dis-i-e:2:b" by blast
ultimately AOT_have \<open>\<phi>{x,y}\<close>
using 2[THEN "&E"(2)] "rule=E" "&E" 0
by (metis id_sym)
AOT_thus \<open>D!x & D!y & \<phi>{x,y}\<close>
using 0 "&E" "&I"
by blast
}
next
AOT_modally_strict {
fix x y
AOT_assume 0: \<open>D!x & D!y & \<phi>{x,y}\<close>
AOT_hence \<open>\<forall>F([F]x \<equiv> [F]x) & \<forall>F([F]y \<equiv> [F]y) & \<phi>{x,y}\<close>
by (meson "con-dis-i-e:2:b" "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E" "oth-class-taut:3:a" "universal-cor")
AOT_hence \<open>\<exists>x' \<exists>y' (\<forall>F([F]x \<equiv> [F]x') & \<forall>F([F]y \<equiv> [F]y') & \<phi>{x',y'})\<close>
using "\<exists>I" by meson
AOT_thus \<open>D!x & D!y & \<exists>x' \<exists>y' (\<forall>F([F]x \<equiv> [F]x') & \<forall>F([F]y \<equiv> [F]y') & \<phi>{x',y'})\<close>
using "&I" "&E" 0 by blast
}
qed
AOT_thus \<open>[\<lambda>xy D!x & D!y & \<exists>x'\<exists>y'(\<forall>F([F]x \<equiv> [F]x') & \<forall>F([F]y \<equiv> [F]y') & \<phi>{x',y'})]\<down> & \<box>\<forall>x\<forall>y(D!x & D!y & \<exists>x'\<exists>y'(\<forall>F([F]x \<equiv> [F]x') & \<forall>F([F]y \<equiv> [F]y') & \<phi>{x',y'}) \<equiv> D!x & D!y & \<phi>{x,y})\<close>
by(safe intro!: "&I" "cqt:2")
qed
AOT_theorem "discern-obj:16": \<open>[\<lambda>xy D!x & D!y & x = y]\<down>\<close>
by (simp add: "discern-obj:15[2]")
AOT_define eq_D :: \<open>\<Pi>\<close> (\<open>'(=\<^sub>D')\<close>)
"discern-obj:17": \<open>(=\<^sub>D) =\<^sub>d\<^sub>f [\<lambda>xy D!x & D!y & \<box>\<forall>F([F]x \<equiv> [F]y)]\<close>
syntax "_AOT_eq_D_infix" :: \<open>\<tau> \<Rightarrow> \<tau> \<Rightarrow> \<phi>\<close> (infixl "=\<^sub>D" 50)
translations
"_AOT_eq_D_infix \<kappa> \<kappa>'" == "CONST AOT_exe (CONST eq_D) (CONST Pair \<kappa> \<kappa>')"
print_translation\<open>
AOT_syntax_print_translations
[(\<^const_syntax>\<open>AOT_exe\<close>, fn ctxt => fn [
Const ("\<^const>AOT_PLM.eq_D", _),
Const (\<^const_syntax>\<open>Pair\<close>, _) $ lhs $ rhs
] => Const (\<^syntax_const>\<open>_AOT_eq_D_infix\<close>, dummyT) $ lhs $ rhs)]\<close>
AOT_theorem "=D[denotes]": \<open>[(=\<^sub>D)]\<down>\<close>
by (rule "=\<^sub>d\<^sub>fI"(2)[OF "discern-obj:17"]) "cqt:2"
(* Note: slight ordering mismatch to make things simpler on automation *)
AOT_theorem "discern-obj:20": \<open>x =\<^sub>D y \<equiv> (D!x & D!y & \<box>\<forall>F ([F]x \<equiv> [F]y))\<close>
proof -
AOT_have 0: \<open>\<guillemotleft>(AOT_term_of_var x,AOT_term_of_var y)\<guillemotright>\<down>\<close>
by (simp add: "&I" "cqt:2[const_var]"[axiom_inst] prod_denotesI)
AOT_have 1: \<open>[\<lambda>xy D!x & D!y & \<box>\<forall>F ([F]x \<equiv> [F]y)]\<down>\<close> by "cqt:2"
show ?thesis apply (rule "=\<^sub>d\<^sub>fI"(2)[OF "discern-obj:17"]; "cqt:2[lambda]"?)
using "beta-C-meta"[THEN "\<rightarrow>E", OF 1, unvarify \<nu>\<^sub>1\<nu>\<^sub>n, of "(_,_)", OF 0]
by fast
qed
AOT_theorem "discern-obj:18": \<open>x =\<^sub>D y \<equiv> (D!x & D!y & x = y)\<close>
proof(safe intro!: "\<equiv>I" "\<rightarrow>I")
AOT_assume \<open>x =\<^sub>D y\<close>
AOT_hence 0: \<open>D!x & D!y & \<box>\<forall>F([F]x \<equiv> [F]y)\<close>
using "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E" "discern-obj:20.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(1).&E(1)"
"discern-obj:20.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(1).&E(2)"
"discern-obj:20.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(2)" "russell-axiom[exe,2,1,1].\<psi>_denotes_asm"
"russell-axiom[exe,2,1,2].\<psi>_denotes_asm" by auto
AOT_hence \<open>\<forall>F([F]x \<equiv> [F]y)\<close>
using "S5Basic:2.\<equiv>E(1)" "S5Basic:4.\<rightarrow>E" "con-dis-i-e:2:b" by blast
AOT_thus \<open>D!x & D!y & x = y\<close>
by (metis (no_types, lifting) "0" "con-dis-taut:2" "con-dis-taut:3" "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E" "discern-obj:7" "intro-elim:3:b"
"oth-class-taut:2:a" "vdash-properties:10")
next
AOT_assume 0: \<open>D!x & D!y & x = y\<close>
moreover AOT_have \<open>\<box>\<forall>F([F]x \<equiv> [F]x)\<close>
by (simp add: "oth-class-taut:3:a" "universal-cor" RN)
ultimately AOT_have \<open>\<box>\<forall>F([F]x \<equiv> [F]y)\<close>
using "rule=E" "&E" id_sym by fast
AOT_thus \<open>x =\<^sub>D y\<close>
using "0" "con-dis-i-e:2:a" "df-simplify:1.\<equiv>E(2)" "discern-obj:20" by blast
qed
AOT_theorem "discern-obj:19": \<open>x =\<^sub>D y \<rightarrow> x = y\<close>
by (metis "deduction-theorem" "discern-obj:18.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(2).rule=E'" "id-eq:1"
"russell-axiom[exe,2,1,1].\<psi>_denotes_asm" "russell-axiom[exe,2,1,2].\<psi>_denotes_asm")
thm "discern-obj:20"
AOT_theorem "discern-obj:21": \<open>x =\<^sub>D y \<equiv> \<box>(x =\<^sub>D y)\<close>
proof (rule "\<equiv>I"; rule "\<rightarrow>I")
AOT_assume 0: \<open>x =\<^sub>D y\<close>
AOT_hence 1: \<open>D!x & D!y & \<box>\<forall>F ([F]x \<equiv> [F]y)\<close>
using "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E" "discern-obj:20.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(1).&E(1)"
"discern-obj:20.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(1).&E(2)"
"discern-obj:20.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(2)" "russell-axiom[exe,2,1,1].\<psi>_denotes_asm"
"russell-axiom[exe,2,1,2].\<psi>_denotes_asm" by force
AOT_hence \<open>\<box>\<forall>F ([F]x \<equiv> [F]y)\<close>
using "&E" by blast
AOT_hence \<open>\<box>\<box>\<forall>F ([F]x \<equiv> [F]y)\<close>
using "S5Basic:5" "vdash-properties:6" by blast
moreover AOT_have \<open>\<box>D!x & \<box>D!y\<close>
by (meson "0" "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E" "cqt:2"(1) "discern-obj:20.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(1).&E(1)"
"discern-obj:20.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(1).&E(2)" "discern-obj:8.unvarify_x.\<forall>E(1).\<rightarrow>E")
AOT_thus \<open>\<box>(x =\<^sub>D y)\<close>
apply (AOT_subst \<open>x =\<^sub>D y\<close> \<open>D!x & D!y & \<box>\<forall>F ([F]x \<equiv> [F]y)\<close>)
apply (simp add: "discern-obj:20")
by (simp add: "KBasic:3.\<equiv>E(2)" "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E" calculation)
next
AOT_assume \<open>\<box>(x =\<^sub>D y)\<close>
AOT_thus \<open>x =\<^sub>D y\<close> using "qml:2"[axiom_inst, THEN "\<rightarrow>E"] by blast
qed
AOT_theorem "discern-obj:22": \<open>\<diamond>(x =\<^sub>D y) \<equiv> (x =\<^sub>D y)\<close>
by (meson "B\<diamond>" "RE\<diamond>" "T\<diamond>" "deduction-theorem" "discern-obj:21" "intro-elim:2" "intro-elim:3:e")
AOT_theorem "discern-obj:23": \<open>\<diamond>(x =\<^sub>D y) \<equiv> \<box>(x =\<^sub>D y)\<close>
using "discern-obj:21" "discern-obj:22" "intro-elim:3:e" by blast
AOT_theorem "discern-obj:24": \<open>(x =\<^sub>D y) \<equiv> \<^bold>\<A>(x =\<^sub>D y)\<close>
by (metis "Act-Sub:3" "deduction-theorem" "discern-obj:21" "discern-obj:22" "intro-elim:2" "intro-elim:3:f" "nec-imp-act")
syntax "_AOT_non_eq_D" :: \<open>\<Pi>\<close> ("'(\<noteq>\<^sub>D')")
translations
(\<Pi>) "(\<noteq>\<^sub>D)" == (\<Pi>) "(=\<^sub>D)\<^sup>-"
syntax "_AOT_non_eq_D_infix" :: \<open>\<tau> \<Rightarrow> \<tau> \<Rightarrow> \<phi>\<close> (infixl "\<noteq>\<^sub>D" 50)
translations
"_AOT_non_eq_D_infix \<kappa> \<kappa>'" ==
"CONST AOT_exe (CONST relation_negation (CONST eq_D)) (CONST Pair \<kappa> \<kappa>')"
print_translation\<open>
AOT_syntax_print_translations
[(\<^const_syntax>\<open>AOT_exe\<close>, fn ctxt => fn [
Const (\<^const_syntax>\<open>relation_negation\<close>, _) $ Const ("\<^const>AOT_PLM.eq_D", _),
Const (\<^const_syntax>\<open>Pair\<close>, _) $ lhs $ rhs
] => Const (\<^syntax_const>\<open>_AOT_non_eq_D_infix\<close>, dummyT) $ lhs $ rhs)]\<close>
AOT_theorem "discern-obj:25": \<open>x \<noteq>\<^sub>D y \<equiv> \<not>(x =\<^sub>D y)\<close>
proof -
AOT_have \<theta>: \<open>[\<lambda>x\<^sub>1...x\<^sub>2 \<not>(=\<^sub>D)x\<^sub>1...x\<^sub>2]\<down>\<close> by "cqt:2"
AOT_have \<open>x \<noteq>\<^sub>D y \<equiv> [\<lambda>x\<^sub>1...x\<^sub>2 \<not>(=\<^sub>D)x\<^sub>1...x\<^sub>2]xy\<close>
by (rule "=\<^sub>d\<^sub>fI"(1)[OF "df-relation-negation", OF \<theta>])
(meson "oth-class-taut:3:a")
also AOT_have \<open>\<dots> \<equiv> \<not>(=\<^sub>D)xy\<close>
apply (rule "beta-C-meta"[THEN "\<rightarrow>E", unvarify \<nu>\<^sub>1\<nu>\<^sub>n])
apply "cqt:2[lambda]"
using "\<equiv>\<^sub>d\<^sub>fI" "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E" "cqt:2"(1) tuple_denotes by blast
finally show ?thesis.
qed
AOT_theorem "discern-obj:26": \<open>x \<noteq>\<^sub>D y \<equiv> \<box>(x \<noteq>\<^sub>D y)\<close>
proof -
AOT_have \<open>x \<noteq>\<^sub>D y \<equiv> \<not>(x =\<^sub>D y)\<close>
using "discern-obj:25" by auto
also AOT_have \<open>\<dots> \<equiv> \<not>\<diamond>(x =\<^sub>D y)\<close>
by (simp add: "T\<diamond>" "contraposition:1[1]" "cqt:2"(1) "deduction-theorem" "discern-obj:22.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1)"
"intro-elim:2")
also AOT_have \<open>\<dots> \<equiv> \<box>\<not>(x =\<^sub>D y)\<close>
by (meson "KBasic2:1" "\<equiv>E"(2) "Commutativity of \<equiv>")
also AOT_have \<open>\<dots> \<equiv> \<box>(x \<noteq>\<^sub>D y)\<close>
using "RM:3" "discern-obj:25" "intro-elim:3:f" "oth-class-taut:3:a" by blast
finally show ?thesis.
qed
AOT_theorem "discern-obj:27": \<open>\<diamond>(x \<noteq>\<^sub>D y) \<equiv> (x \<noteq>\<^sub>D y)\<close>
by (meson "RE\<diamond>" "S5Basic:2" "discern-obj:26" "\<equiv>E"(2,5) "Commutativity of \<equiv>")
AOT_theorem "discern-obj:28": \<open>\<diamond>(x \<noteq>\<^sub>D y) \<equiv> \<box>(x \<noteq>\<^sub>D y)\<close>
by (meson "discern-obj:27" "discern-obj:26" "\<equiv>E"(5))
AOT_theorem "discern-obj:29": \<open>x =\<^sub>D y \<equiv> \<^bold>\<A>x =\<^sub>D y\<close>
by (meson "Act-Basic:5" "Act-Sub:2" "RA[2]" "discern-obj:24" "\<equiv>E"(1,6))
AOT_theorem "discern-obj:30": \<open>D!x \<rightarrow> x =\<^sub>D x\<close>
by (simp add: "con-dis-i-e:1" "deduction-theorem" "discern-obj:18.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(2)" "rule=I:1"
"russell-axiom[exe,1].\<psi>_denotes_asm")
AOT_theorem "discern-obj:31": \<open>x =\<^sub>D y \<rightarrow> y =\<^sub>D x\<close>
proof(rule "\<rightarrow>I")
AOT_assume 0: \<open>x =\<^sub>D y\<close>
AOT_hence \<open>D!x & D!y & \<box>\<forall>F([F]x \<equiv> [F]y)\<close>
using "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E" "discern-obj:20.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(1).&E(1)"
"discern-obj:20.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(1).&E(2)"
"discern-obj:20.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(2)" "russell-axiom[exe,2,1,1].\<psi>_denotes_asm"
"russell-axiom[exe,2,1,2].\<psi>_denotes_asm" by force
AOT_hence \<open>D!y & D!x & \<box>\<forall>F([F]y \<equiv> [F]x)\<close>
by (metis (no_types, lifting) ext "0" "Commutativity of \<equiv>" "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E"
"discern-obj:20.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(1).&E(1)"
"discern-obj:20.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(1).&E(2)"
"discern-obj:20.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(2)" "rule-sub-lem:1:d" "rule-sub-lem:1:g.\<equiv>E(2)"
"russell-axiom[exe,2,1,1].\<psi>_denotes_asm" "russell-axiom[exe,2,1,2].\<psi>_denotes_asm" RN)
AOT_thus \<open>y =\<^sub>D x\<close>
by (simp add: "cqt:2"(1) "discern-obj:20.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(2)")
qed
AOT_theorem "discern-obj:32": \<open>x =\<^sub>D y & y =\<^sub>D z \<rightarrow> x =\<^sub>D z\<close>
proof(rule "\<rightarrow>I")
AOT_assume A: \<open>x =\<^sub>D y & y =\<^sub>D z\<close>
AOT_hence 0: \<open>D!x\<close> and 1: \<open>D!y\<close> and 2: \<open>D!z\<close> and \<open>\<box>\<forall>F([F]x \<equiv> [F]y)\<close> and \<open>\<box>\<forall>F([F]y \<equiv> [F]z)\<close>
using "discern-obj:20" "intro-elim:3:a" "&E"
by meson+
AOT_hence \<open>\<box>(\<forall>F([F]x \<equiv> [F]y) & \<forall>F([F]y \<equiv> [F]z))\<close>
by (smt (verit) "KBasic:3" "df-simplify:1" "intro-elim:3:b")
moreover AOT_have \<open>\<box>(\<forall>F([F]x \<equiv> [F]y) & \<forall>F([F]y \<equiv> [F]z)) \<rightarrow> \<box>\<forall>F([F]x \<equiv> [F]z)\<close>
apply (rule RM)
by (simp add: "cqt-basic:10")
ultimately AOT_have \<open>\<box>\<forall>F([F]x \<equiv> [F]z)\<close>
using "vdash-properties:6" by blast
AOT_thus \<open>x =\<^sub>D z\<close>
by (simp add: "0" "2" "discern-obj:20.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(2)" "con-dis-i-e:1" "cqt:2"(1))
qed
AOT_theorem "discern-obj:33": \<open>D!x \<or> D!y \<rightarrow> \<box>(x = y \<equiv> x =\<^sub>D y)\<close>
proof(rule "\<rightarrow>I")
AOT_assume 0: \<open>D!x \<or> D!y\<close>
{
fix x y
AOT_assume Dx: \<open>D!x\<close>
AOT_have \<open>(x = y \<equiv> x =\<^sub>D y)\<close>
proof(safe intro!: "\<equiv>I" "\<rightarrow>I")
AOT_assume \<open>x = y\<close>
moreover AOT_hence \<open>D!y\<close>
using "rule=E'" Dx by blast
ultimately AOT_show \<open>x =\<^sub>D y\<close>
by (metis (mono_tags, lifting) "discern-obj:20.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(2)" "\<equiv>I" "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E" "cqt:2"(1) "ind-nec.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<rightarrow>E" "rule=E'" CP GEN id_sym)
next
AOT_assume \<open>x =\<^sub>D y\<close>
AOT_thus \<open>x = y\<close>
using "discern-obj:18.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(2).rule=E'" "id-eq:1" "russell-axiom[exe,2,1,1].\<psi>_denotes_asm"
"russell-axiom[exe,2,1,2].\<psi>_denotes_asm" by blast
qed
} note 1 = this
{
AOT_assume \<open>D!x\<close>
AOT_hence \<open>(x = y \<equiv> x =\<^sub>D y)\<close>
using 1 by blast
moreover AOT_have \<open>(x = y) \<equiv> \<box>(x = y)\<close>
by (simp add: "id-nec:2" "intro-elim:2" "qml:2" "vdash-properties:1[2]")
moreover AOT_have \<open>(x =\<^sub>D y) \<equiv> \<box>(x =\<^sub>D y)\<close>
using "discern-obj:21" by auto
ultimately AOT_have \<open>\<box>(x = y \<equiv> x =\<^sub>D y)\<close>
proof (safe intro!: "sc-eq-box-box:4"[THEN "\<rightarrow>E", THEN "\<rightarrow>E"] "&I")
AOT_show \<open>\<box>(x = y \<rightarrow> \<box>x = y)\<close>
by (simp add: "id-nec:1" RN)
next
AOT_show \<open>\<box>(x =\<^sub>D y \<rightarrow> \<box>x =\<^sub>D y)\<close>
using "discern-obj:21"
by (meson "if-p-then-p" "rule-sub-remark:6[1]" RN)
next
AOT_assume \<open>x = y \<equiv> x =\<^sub>D y\<close>
moreover AOT_assume \<open>x = y \<equiv> \<box>x = y\<close>
moreover AOT_assume \<open>x =\<^sub>D y \<equiv> \<box>x =\<^sub>D y\<close>
ultimately AOT_show \<open>\<box>x = y \<equiv> \<box>x =\<^sub>D y\<close>
using "intro-elim:3:f" by blast
qed
}
moreover {
AOT_assume Dy: \<open>D!y\<close>
AOT_hence 0: \<open>y = x \<equiv> y =\<^sub>D x\<close>
using 1 by blast
AOT_hence \<open>x = y \<equiv> x =\<^sub>D y\<close>
proof(safe intro!: "\<equiv>I" "\<rightarrow>I")
AOT_assume 2: \<open>x = y\<close>
AOT_hence 3: \<open>y = x\<close> using id_sym by blast
AOT_hence \<open>y =\<^sub>D x\<close> using 0[THEN "\<equiv>E"(1)] by blast
AOT_thus \<open>x =\<^sub>D y\<close>
using "1" "2" "3" "intro-elim:3:a" "rule=E" Dy by blast
next
AOT_assume \<open>x =\<^sub>D y\<close>
AOT_thus \<open>x = y\<close>
using "cqt:2"(1) "discern-obj:18.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(2).rule=E'" "rule=I:1" by blast
qed
moreover AOT_have \<open>(x = y) \<equiv> \<box>(x = y)\<close>
by (simp add: "id-nec:2" "intro-elim:2" "qml:2" "vdash-properties:1[2]")
moreover AOT_have \<open>(x =\<^sub>D y) \<equiv> \<box>(x =\<^sub>D y)\<close>
using "discern-obj:21" by auto
ultimately AOT_have \<open>\<box>(x = y \<equiv> x =\<^sub>D y)\<close>
proof (safe intro!: "sc-eq-box-box:4"[THEN "\<rightarrow>E", THEN "\<rightarrow>E"] "&I")
AOT_show \<open>\<box>(x = y \<rightarrow> \<box>x = y)\<close>
by (simp add: "id-nec:1" RN)
next
AOT_show \<open>\<box>(x =\<^sub>D y \<rightarrow> \<box>x =\<^sub>D y)\<close>
using "discern-obj:21"
by (meson "if-p-then-p" "rule-sub-remark:6[1]" RN)
next
AOT_assume \<open>x = y \<equiv> x =\<^sub>D y\<close>
moreover AOT_assume \<open>x = y \<equiv> \<box>x = y\<close>
moreover AOT_assume \<open>x =\<^sub>D y \<equiv> \<box>x =\<^sub>D y\<close>
ultimately AOT_show \<open>\<box>x = y \<equiv> \<box>x =\<^sub>D y\<close>
using "intro-elim:3:f" by blast
qed
}
ultimately AOT_show \<open>\<box>(x = y \<equiv> x =\<^sub>D y)\<close>
using 0 by (metis "con-dis-i-e:4:b" "raa-cor:1")
qed
AOT_theorem "discern-obj:34": \<open>D!y \<rightarrow> [\<lambda>x x = y]\<down>\<close>
proof(safe intro!: "\<rightarrow>I")
AOT_assume Dy: \<open>D!y\<close>
AOT_show \<open>[\<lambda>x x = y]\<down>\<close>
proof (rule "safe-ext"[axiom_inst, THEN "\<rightarrow>E"]; rule "&I")
AOT_show \<open>[\<lambda>x D!x & x = y]\<down>\<close>
by (simp add: "discern-obj:13")
next
AOT_have \<open>\<box>(D!y \<rightarrow> \<forall>x (D!x & x = y \<equiv> x = y))\<close>
by (smt (verit, del_insts) "con-dis-i-e:2:b" "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E" "deduction-theorem" "intro-elim:2" "rule=E" "universal-cor" RN
id_sym)
AOT_thus\<open>\<box>\<forall>x (D!x & x = y \<equiv> x = y)\<close>
by (meson "KBasic:1.\<rightarrow>E" "KBasic:5.\<rightarrow>E.\<equiv>E(2)" "con-dis-i-e:1" "discern-obj:8.unvarify_x.\<forall>E(1).\<rightarrow>E"
"russell-axiom[exe,1].\<psi>_denotes_asm" Dy)
qed
qed
AOT_theorem "discern-obj:35": \<open>(D!x & D!y) \<rightarrow> (x \<noteq> y \<equiv> [\<lambda>z z = x] \<noteq> [\<lambda>z z = y])\<close>
proof(safe intro!: "\<rightarrow>I" "\<equiv>I")
AOT_assume 0: \<open>D!x & D!y\<close>
AOT_assume 1: \<open>x \<noteq> y\<close>
AOT_show \<open>[\<lambda>z z = x] \<noteq> [\<lambda>z z = y]\<close>
proof(rule "raa-cor:1")
AOT_assume \<open>\<not>[\<lambda>z z = x] \<noteq> [\<lambda>z z = y]\<close>
AOT_hence \<open>[\<lambda>z z = x] = [\<lambda>z z = y]\<close>
using "=-infix" "\<equiv>\<^sub>d\<^sub>fI" "reductio-aa:1" by blast
moreover AOT_have \<open>[\<lambda>z z = x]x\<close>
using "0" "betaC:2:a" "con-dis-i-e:2:a" "cqt:2"(1) "discern-obj:34" "id-eq:1" "vdash-properties:10" by blast
ultimately AOT_have \<open>[\<lambda>z z = y]x\<close>
using "rule=E" by fast
AOT_hence \<open>x = y\<close>
using "betaC:1:a" by blast
AOT_thus \<open>x = y & \<not>x = y\<close>
using "1" "=-infix" "\<equiv>\<^sub>d\<^sub>fE" "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E" by blast
qed
next
AOT_assume 0: \<open>D!x & D!y\<close>
AOT_assume 1: \<open>[\<lambda>z z = x] \<noteq> [\<lambda>z z = y]\<close>
AOT_show \<open>x \<noteq> y\<close>
proof(rule "raa-cor:1")
AOT_assume \<open>\<not>x \<noteq> y\<close>
AOT_hence \<open>x = y\<close>
using "=-infix" "df-rules-formulas[4]" "useful-tautologies:7.\<rightarrow>E.\<rightarrow>E" by blast
moreover AOT_have \<open>[\<lambda>z z = x] = [\<lambda>z z = x]\<close>
using "0" "con-dis-i-e:2:a" "discern-obj:34.unvarify_y.\<forall>E(1).\<rightarrow>E" "rule=I:1" "russell-axiom[exe,1].\<psi>_denotes_asm" by blast
ultimately AOT_have \<open>[\<lambda>z z = x] = [\<lambda>z z = y]\<close>
using "rule=E" by fast
AOT_thus \<open>[\<lambda>z z = x] = [\<lambda>z z = y] & \<not>[\<lambda>z z = x] = [\<lambda>z z = y]\<close>
using 1 "=-infix" "\<equiv>\<^sub>d\<^sub>fE" "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E" by blast
qed
qed
AOT_register_rigid_restricted_type
Discernible: \<open>D!\<kappa>\<close>
proof
AOT_modally_strict {
AOT_show \<open>\<exists>x D!x\<close>
using "discern-obj:5" by blast
}
next
AOT_modally_strict {
AOT_show \<open>D!\<kappa> \<rightarrow> \<kappa>\<down>\<close> for \<kappa>
by (simp add: "deduction-theorem" "russell-axiom[exe,1].\<psi>_denotes_asm")
}
next
AOT_modally_strict {
AOT_have \<open>D!x \<rightarrow> \<box>D!x\<close> for x
using "discern-obj:8" by auto
AOT_thus \<open>\<forall>x (D!x \<rightarrow> \<box>D!x)\<close>
by (rule GEN)
}
qed
text\<open>We have already introduced the restricted type of Ordinary objects in the
Extended Relation Comprehension theory. However, make sure all variable names
are defined as expected (avoiding conflicts with situations
of possible world theory).\<close>
AOT_register_variable_names
Discernible: u v r t s
section\<open>Natural Numbers\<close>
AOT_define CorrelatesOneToOne :: \<open>\<tau> \<Rightarrow> \<tau> \<Rightarrow> \<tau> \<Rightarrow> \<phi>\<close> (\<open>_ |: _ \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow> _\<close>)
"1-1-cor": \<open>R |: F \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow> G \<equiv>\<^sub>d\<^sub>f R\<down> & F\<down> & G\<down> &
\<forall>x ([F]x \<rightarrow> \<exists>!y([G]y & [R]xy)) &
\<forall>y ([G]y \<rightarrow> \<exists>!x([F]x & [R]xy))\<close>
AOT_define MapsTo :: \<open>\<tau> \<Rightarrow> \<tau> \<Rightarrow> \<tau> \<Rightarrow> \<phi>\<close> (\<open>_ |: _ \<longrightarrow> _\<close>)
"fFG:1": \<open>R |: F \<longrightarrow> G \<equiv>\<^sub>d\<^sub>f R\<down> & F\<down> & G\<down> & \<forall>x ([F]x \<rightarrow> \<exists>!y([G]y & [R]xy))\<close>
AOT_define MapsToOneToOne :: \<open>\<tau> \<Rightarrow> \<tau> \<Rightarrow> \<tau> \<Rightarrow> \<phi>\<close> (\<open>_ |: _ \<^sub>1\<^sub>-\<^sub>1\<longrightarrow> _\<close>)
"fFG:2": \<open>R |: F \<^sub>1\<^sub>-\<^sub>1\<longrightarrow> G \<equiv>\<^sub>d\<^sub>f
R |: F \<longrightarrow> G & \<forall>x\<forall>y\<forall>z (([F]x & [F]y & [G]z) \<rightarrow> ([R]xz & [R]yz \<rightarrow> x = y))\<close>
AOT_define MapsOnto :: \<open>\<tau> \<Rightarrow> \<tau> \<Rightarrow> \<tau> \<Rightarrow> \<phi>\<close> (\<open>_ |: _ \<longrightarrow>\<^sub>o\<^sub>n\<^sub>t\<^sub>o _\<close>)
"fFG:3": \<open>R |: F \<longrightarrow>\<^sub>o\<^sub>n\<^sub>t\<^sub>o G \<equiv>\<^sub>d\<^sub>f R |: F \<longrightarrow> G & \<forall>y ([G]y \<rightarrow> \<exists>x([F]x & [R]xy))\<close>
AOT_define MapsOneToOneOnto :: \<open>\<tau> \<Rightarrow> \<tau> \<Rightarrow> \<tau> \<Rightarrow> \<phi>\<close> (\<open>_ |: _ \<^sub>1\<^sub>-\<^sub>1\<longrightarrow>\<^sub>o\<^sub>n\<^sub>t\<^sub>o _\<close>)
"fFG:4": \<open>R |: F \<^sub>1\<^sub>-\<^sub>1\<longrightarrow>\<^sub>o\<^sub>n\<^sub>t\<^sub>o G \<equiv>\<^sub>d\<^sub>f R |: F \<^sub>1\<^sub>-\<^sub>1\<longrightarrow> G & R |: F \<longrightarrow>\<^sub>o\<^sub>n\<^sub>t\<^sub>o G\<close>
AOT_theorem "eq-1-1": \<open>R |: F \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow> G \<equiv> R |: F \<^sub>1\<^sub>-\<^sub>1\<longrightarrow>\<^sub>o\<^sub>n\<^sub>t\<^sub>o G\<close>
proof(rule "\<equiv>I"; rule "\<rightarrow>I")
AOT_assume \<open>R |: F \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow> G\<close>
AOT_hence A: \<open>\<forall>x ([F]x \<rightarrow> \<exists>!y([G]y & [R]xy))\<close>
and B: \<open>\<forall>y ([G]y \<rightarrow> \<exists>!x([F]x & [R]xy))\<close>
using "\<equiv>\<^sub>d\<^sub>fE"[OF "1-1-cor"] "&E" by blast+
AOT_have C: \<open>R |: F \<longrightarrow> G\<close>
proof (rule "\<equiv>\<^sub>d\<^sub>fI"[OF "fFG:1"]; rule "&I")
AOT_show \<open>R\<down> & F\<down> & G\<down>\<close>
using "cqt:2[const_var]"[axiom_inst] "&I" by metis
next
AOT_show \<open>\<forall>x ([F]x \<rightarrow> \<exists>!y([G]y & [R]xy))\<close> by (rule A)
qed
AOT_show \<open>R |: F \<^sub>1\<^sub>-\<^sub>1\<longrightarrow>\<^sub>o\<^sub>n\<^sub>t\<^sub>o G\<close>
proof (rule "\<equiv>\<^sub>d\<^sub>fI"[OF "fFG:4"]; rule "&I")
AOT_show \<open>R |: F \<^sub>1\<^sub>-\<^sub>1\<longrightarrow> G\<close>
proof (rule "\<equiv>\<^sub>d\<^sub>fI"[OF "fFG:2"]; rule "&I")
AOT_show \<open>R |: F \<longrightarrow> G\<close> using C.
next
AOT_show \<open>\<forall>x\<forall>y\<forall>z ([F]x & [F]y & [G]z \<rightarrow> ([R]xz & [R]yz \<rightarrow> x = y))\<close>
proof(rule GEN; rule GEN; rule GEN; rule "\<rightarrow>I"; rule "\<rightarrow>I")
fix x y z
AOT_assume 1: \<open>[F]x & [F]y & [G]z\<close>
moreover AOT_assume 2: \<open>[R]xz & [R]yz\<close>
ultimately AOT_have 3: \<open>\<exists>!x ([F]x & [R]xz)\<close>
using B "&E" "\<forall>E" "\<rightarrow>E" by fast
AOT_show \<open>x = y\<close>
by (rule "uni-most"[THEN "\<rightarrow>E", OF 3, THEN "\<forall>E"(2)[where \<beta>=x],
THEN "\<forall>E"(2)[where \<beta>=y], THEN "\<rightarrow>E"])
(metis "&I" "&E" 1 2)
qed
qed
next
AOT_show \<open>R |: F \<longrightarrow>\<^sub>o\<^sub>n\<^sub>t\<^sub>o G\<close>
proof (rule "\<equiv>\<^sub>d\<^sub>fI"[OF "fFG:3"]; rule "&I")
AOT_show \<open>R |: F \<longrightarrow> G\<close> using C.
next
AOT_show \<open>\<forall>y ([G]y \<rightarrow> \<exists>x ([F]x & [R]xy))\<close>
proof(rule GEN; rule "\<rightarrow>I")
fix y
AOT_assume \<open>[G]y\<close>
AOT_hence \<open>\<exists>!x ([F]x & [R]xy)\<close>
using B[THEN "\<forall>E"(2), THEN "\<rightarrow>E"] by blast
AOT_hence \<open>\<exists>x ([F]x & [R]xy & \<forall>\<beta> (([F]\<beta> & [R]\<beta>y) \<rightarrow> \<beta> = x))\<close>
using "uniqueness:1"[THEN "\<equiv>\<^sub>d\<^sub>fE"] by blast
then AOT_obtain x where \<open>[F]x & [R]xy\<close>
using "\<exists>E"[rotated] "&E" by blast
AOT_thus \<open>\<exists>x ([F]x & [R]xy)\<close> by (rule "\<exists>I")
qed
qed
qed
next
AOT_assume \<open>R |: F \<^sub>1\<^sub>-\<^sub>1\<longrightarrow>\<^sub>o\<^sub>n\<^sub>t\<^sub>o G\<close>
AOT_hence \<open>R |: F \<^sub>1\<^sub>-\<^sub>1\<longrightarrow> G\<close> and \<open>R |: F \<longrightarrow>\<^sub>o\<^sub>n\<^sub>t\<^sub>o G\<close>
using "\<equiv>\<^sub>d\<^sub>fE"[OF "fFG:4"] "&E" by blast+
AOT_hence C: \<open>R |: F \<longrightarrow> G\<close>
and D: \<open>\<forall>x\<forall>y\<forall>z ([F]x & [F]y & [G]z \<rightarrow> ([R]xz & [R]yz \<rightarrow> x = y))\<close>
and E: \<open>\<forall>y ([G]y \<rightarrow> \<exists>x ([F]x & [R]xy))\<close>
using "\<equiv>\<^sub>d\<^sub>fE"[OF "fFG:2"] "\<equiv>\<^sub>d\<^sub>fE"[OF "fFG:3"] "&E" by blast+
AOT_show \<open>R |: F \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow> G\<close>
proof(rule "1-1-cor"[THEN "\<equiv>\<^sub>d\<^sub>fI"]; safe intro!: "&I" "cqt:2[const_var]"[axiom_inst])
AOT_show \<open>\<forall>x ([F]x \<rightarrow> \<exists>!y ([G]y & [R]xy))\<close>
using "\<equiv>\<^sub>d\<^sub>fE"[OF "fFG:1", OF C] "&E" by blast
next
AOT_show \<open>\<forall>y ([G]y \<rightarrow> \<exists>!x ([F]x & [R]xy))\<close>
proof (rule "GEN"; rule "\<rightarrow>I")
fix y
AOT_assume 0: \<open>[G]y\<close>
AOT_hence \<open>\<exists>x ([F]x & [R]xy)\<close>
using E "\<forall>E" "\<rightarrow>E" by fast
then AOT_obtain a where a_prop: \<open>[F]a & [R]ay\<close>
using "\<exists>E"[rotated] by blast
moreover AOT_have \<open>\<forall>z ([F]z & [R]zy \<rightarrow> z = a)\<close>
proof (rule GEN; rule "\<rightarrow>I")
fix z
AOT_assume \<open>[F]z & [R]zy\<close>
AOT_thus \<open>z = a\<close>
using D[THEN "\<forall>E"(2)[where \<beta>=z], THEN "\<forall>E"(2)[where \<beta>=a],
THEN "\<forall>E"(2)[where \<beta>=y], THEN "\<rightarrow>E", THEN "\<rightarrow>E"]
a_prop 0 "&E" "&I" by metis
qed
ultimately AOT_have \<open>\<exists>x ([F]x & [R]xy & \<forall>z ([F]z & [R]zy \<rightarrow> z = x))\<close>
using "&I" "\<exists>I"(2) by fast
AOT_thus \<open>\<exists>!x ([F]x & [R]xy)\<close>
using "uniqueness:1"[THEN "\<equiv>\<^sub>d\<^sub>fI"] by fast
qed
qed
qed
AOT_theorem "equi:1": \<open>\<exists>!u \<phi>{u} \<equiv> \<exists>u (\<phi>{u} & \<forall>v (\<phi>{v} \<rightarrow> v =\<^sub>D u))\<close>
proof(rule "\<equiv>I"; rule "\<rightarrow>I")
AOT_assume \<open>\<exists>!u \<phi>{u}\<close>
AOT_hence \<open>\<exists>!x (D!x & \<phi>{x})\<close>.
AOT_hence \<open>\<exists>x (D!x & \<phi>{x} & \<forall>\<beta> (D!\<beta> & \<phi>{\<beta>} \<rightarrow> \<beta> = x))\<close>
using "uniqueness:1"[THEN "\<equiv>\<^sub>d\<^sub>fE"] by blast
then AOT_obtain x where x_prop: \<open>D!x & \<phi>{x} & \<forall>\<beta> (D!\<beta> & \<phi>{\<beta>} \<rightarrow> \<beta> = x)\<close>
using "\<exists>E"[rotated] by blast
{
fix \<beta>
AOT_assume beta_ord: \<open>D!\<beta>\<close>
moreover AOT_assume \<open>\<phi>{\<beta>}\<close>
ultimately AOT_have \<open>\<beta> = x\<close>
using x_prop[THEN "&E"(2), THEN "\<forall>E"(2)[where \<beta>=\<beta>]] "&I" "\<rightarrow>E" by blast
AOT_hence \<open>\<beta> =\<^sub>D x\<close>
by (metis "con-dis-taut:5.\<rightarrow>E.\<rightarrow>E" "discern-obj:18.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(2)" "rule=E'"
"russell-axiom[exe,1].\<psi>_denotes_asm" beta_ord)
}
AOT_hence \<open>(D!\<beta> \<rightarrow> (\<phi>{\<beta>} \<rightarrow> \<beta> =\<^sub>D x))\<close> for \<beta>
using "\<rightarrow>I" by blast
AOT_hence \<open>\<forall>\<beta>(D!\<beta> \<rightarrow> (\<phi>{\<beta>} \<rightarrow> \<beta> =\<^sub>D x))\<close>
by (rule GEN)
AOT_hence \<open>D!x & \<phi>{x} & \<forall>y (D!y \<rightarrow> (\<phi>{y} \<rightarrow> y =\<^sub>D x))\<close>
using x_prop[THEN "&E"(1)] "&I" by blast
AOT_hence \<open>D!x & (\<phi>{x} & \<forall>y (D!y \<rightarrow> (\<phi>{y} \<rightarrow> y =\<^sub>D x)))\<close>
using "&E" "&I" by meson
AOT_thus \<open>\<exists>u (\<phi>{u} & \<forall>v (\<phi>{v} \<rightarrow> v =\<^sub>D u))\<close>
using "\<exists>I" by fast
next
AOT_assume \<open>\<exists>u (\<phi>{u} & \<forall>v (\<phi>{v} \<rightarrow> v =\<^sub>D u))\<close>
AOT_hence \<open>\<exists>x (D!x & (\<phi>{x} & \<forall>y (D!y \<rightarrow> (\<phi>{y} \<rightarrow> y =\<^sub>D x))))\<close>
by blast
then AOT_obtain x where x_prop: \<open>D!x & (\<phi>{x} & \<forall>y (D!y \<rightarrow> (\<phi>{y} \<rightarrow> y =\<^sub>D x)))\<close>
using "\<exists>E"[rotated] by blast
AOT_have \<open>\<forall>y (D!y & \<phi>{y} \<rightarrow> y = x)\<close>
proof(rule GEN; rule "\<rightarrow>I")
fix y
AOT_assume \<open>D!y & \<phi>{y}\<close>
AOT_hence \<open>y =\<^sub>D x\<close>
using x_prop[THEN "&E"(2), THEN "&E"(2), THEN "\<forall>E"(2)[where \<beta>=y]]
"\<rightarrow>E" "&E" by blast
AOT_thus \<open>y = x\<close>
using "discern-obj:19" "vdash-properties:10" by blast
qed
AOT_hence \<open>D!x & \<phi>{x} & \<forall>y (D!y & \<phi>{y} \<rightarrow> y = x)\<close>
using x_prop "&E" "&I" by meson
AOT_hence \<open>\<exists>x (D!x & \<phi>{x} & \<forall>y (D!y & \<phi>{y} \<rightarrow> y = x))\<close>
by (rule "\<exists>I")
AOT_hence \<open>\<exists>!x (D!x & \<phi>{x})\<close>
by (rule "uniqueness:1"[THEN "\<equiv>\<^sub>d\<^sub>fI"])
AOT_thus \<open>\<exists>!u \<phi>{u}\<close>.
qed
AOT_define CorrelatesDOneToOne :: \<open>\<tau> \<Rightarrow> \<tau> \<Rightarrow> \<tau> \<Rightarrow> \<phi>\<close> (\<open>_ |: _ \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow>\<^sub>D _\<close>)
"equi:2": \<open>R |: F \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow>\<^sub>D G \<equiv>\<^sub>d\<^sub>f R\<down> & F\<down> & G\<down> &
\<forall>u ([F]u \<rightarrow> \<exists>!v([G]v & [R]uv)) &
\<forall>v ([G]v \<rightarrow> \<exists>!u([F]u & [R]uv))\<close>
AOT_define EquinumerousE :: \<open>\<tau> \<Rightarrow> \<tau> \<Rightarrow> \<phi>\<close> (infixl "\<approx>\<^sub>D" 50)
"equi:3": \<open>F \<approx>\<^sub>D G \<equiv>\<^sub>d\<^sub>f \<exists>R (R |: F \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow>\<^sub>D G)\<close>
text\<open>Note: not explicitly in PLM.\<close>
AOT_theorem eq_den_1: \<open>\<Pi>\<down>\<close> if \<open>\<Pi> \<approx>\<^sub>D \<Pi>'\<close>
proof -
AOT_have \<open>\<exists>R (R |: \<Pi> \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow>\<^sub>D \<Pi>')\<close>
using "equi:3"[THEN "\<equiv>\<^sub>d\<^sub>fE"] that by blast
then AOT_obtain R where \<open>R |: \<Pi> \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow>\<^sub>D \<Pi>'\<close>
using "\<exists>E"[rotated] by blast
AOT_thus \<open>\<Pi>\<down>\<close>
using "equi:2"[THEN "\<equiv>\<^sub>d\<^sub>fE"] "&E" by blast
qed
text\<open>Note: not explicitly in PLM.\<close>
AOT_theorem eq_den_2: \<open>\<Pi>'\<down>\<close> if \<open>\<Pi> \<approx>\<^sub>D \<Pi>'\<close>
proof -
AOT_have \<open>\<exists>R (R |: \<Pi> \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow>\<^sub>D \<Pi>')\<close>
using "equi:3"[THEN "\<equiv>\<^sub>d\<^sub>fE"] that by blast
then AOT_obtain R where \<open>R |: \<Pi> \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow>\<^sub>D \<Pi>'\<close>
using "\<exists>E"[rotated] by blast
AOT_thus \<open>\<Pi>'\<down>\<close>
using "equi:2"[THEN "\<equiv>\<^sub>d\<^sub>fE"] "&E" by blast+
qed
AOT_theorem "eq-part:1": \<open>F \<approx>\<^sub>D F\<close>
proof (safe intro!: "&I" GEN "\<rightarrow>I" "cqt:2[const_var]"[axiom_inst]
"\<equiv>\<^sub>d\<^sub>fI"[OF "equi:3"] "\<equiv>\<^sub>d\<^sub>fI"[OF "equi:2"] "\<exists>I"(1))
fix x
AOT_assume 1: \<open>D!x\<close>
AOT_assume 2: \<open>[F]x\<close>
AOT_show \<open>\<exists>!v ([F]v & x =\<^sub>D v)\<close>
proof(rule "equi:1"[THEN "\<equiv>E"(2)];
rule "\<exists>I"(2)[where \<beta>=x];
safe dest!: "&E"(2)
intro!: "&I" "\<rightarrow>I" 1 2 Discernible.GEN)
AOT_show \<open>x =\<^sub>D x\<close>
using "1" "discern-obj:30.unvarify_x.\<forall>E(1).\<rightarrow>E" "russell-axiom[exe,1].\<psi>_denotes_asm" by force
AOT_show \<open>v =\<^sub>D x\<close> if \<open>x =\<^sub>D v\<close> for v
by (simp add: "cqt:2"(1) "discern-obj:31.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<rightarrow>E" that)
qed
next
fix y
AOT_assume 1: \<open>D!y\<close>
AOT_assume 2: \<open>[F]y\<close>
AOT_show \<open>\<exists>!u ([F]u & u =\<^sub>D y)\<close>
by(safe dest!: "&E"(2)
intro!: "equi:1"[THEN "\<equiv>E"(2)] "\<exists>I"(2)[where \<beta>=y]
"&I" "\<rightarrow>I" 1 2 GEN "discern-obj:30"[THEN "\<rightarrow>E"])
qed(auto simp: "=D[denotes]")
AOT_theorem "eq-part:2": \<open>F \<approx>\<^sub>D G \<rightarrow> G \<approx>\<^sub>D F\<close>
proof (rule "\<rightarrow>I")
AOT_assume \<open>F \<approx>\<^sub>D G\<close>
AOT_hence \<open>\<exists>R R |: F \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow>\<^sub>D G\<close>
using "equi:3"[THEN "\<equiv>\<^sub>d\<^sub>fE"] by blast
then AOT_obtain R where \<open>R |: F \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow>\<^sub>D G\<close>
using "\<exists>E"[rotated] by blast
AOT_hence 0: \<open>R\<down> & F\<down> & G\<down> & \<forall>u ([F]u \<rightarrow> \<exists>!v([G]v & [R]uv)) &
\<forall>v ([G]v \<rightarrow> \<exists>!u([F]u & [R]uv))\<close>
using "equi:2"[THEN "\<equiv>\<^sub>d\<^sub>fE"] by blast
AOT_have \<open>[\<lambda>xy [R]yx]\<down> & G\<down> & F\<down> & \<forall>u ([G]u \<rightarrow> \<exists>!v([F]v & [\<lambda>xy [R]yx]uv)) &
\<forall>v ([F]v \<rightarrow> \<exists>!u([G]u & [\<lambda>xy [R]yx]uv))\<close>
proof (AOT_subst \<open>[\<lambda>xy [R]yx]yx\<close> \<open>[R]xy\<close> for: x y;
(safe intro!: "&I" "cqt:2[const_var]"[axiom_inst] 0[THEN "&E"(2)]
0[THEN "&E"(1), THEN "&E"(2)]; "cqt:2[lambda]")?)
AOT_modally_strict {
AOT_have \<open>[\<lambda>xy [R]yx]xy\<close> if \<open>[R]yx\<close> for y x
by (auto intro!: "\<beta>\<leftarrow>C"(1) "cqt:2"
simp: "&I" "ex:1:a" prod_denotesI "rule-ui:3" that)
moreover AOT_have \<open>[R]yx\<close> if \<open>[\<lambda>xy [R]yx]xy\<close> for y x
using "\<beta>\<rightarrow>C"(1)[where \<phi>="\<lambda>(x,y). _ (x,y)" and \<kappa>\<^sub>1\<kappa>\<^sub>n="(_,_)",
simplified, OF that, simplified].
ultimately AOT_show \<open>[\<lambda>xy [R]yx]\<alpha>\<beta> \<equiv> [R]\<beta>\<alpha>\<close> for \<alpha> \<beta>
by (metis "deduction-theorem" "\<equiv>I")
}
qed
AOT_hence \<open>[\<lambda>xy [R]yx] |: G \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow>\<^sub>D F\<close>
using "equi:2"[THEN "\<equiv>\<^sub>d\<^sub>fI"] by blast
AOT_hence \<open>\<exists>R R |: G \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow>\<^sub>D F\<close>
by (rule "\<exists>I"(1)) "cqt:2[lambda]"
AOT_thus \<open>G \<approx>\<^sub>D F\<close>
using "equi:3"[THEN "\<equiv>\<^sub>d\<^sub>fI"] by blast
qed
text\<open>Note: not explicitly in PLM.\<close>
AOT_theorem "eq-part:2[terms]": \<open>\<Pi> \<approx>\<^sub>D \<Pi>' \<rightarrow> \<Pi>' \<approx>\<^sub>D \<Pi>\<close>
using "eq-part:2"[unvarify F G] eq_den_1 eq_den_2 "\<rightarrow>I" by meson
declare "eq-part:2[terms]"[THEN "\<rightarrow>E", sym]
AOT_theorem "eq-part:3": \<open>(F \<approx>\<^sub>D G & G \<approx>\<^sub>D H) \<rightarrow> F \<approx>\<^sub>D H\<close>
proof (rule "\<rightarrow>I")
AOT_assume \<open>F \<approx>\<^sub>D G & G \<approx>\<^sub>D H\<close>
then AOT_obtain R\<^sub>1 and R\<^sub>2 where
\<open>R\<^sub>1 |: F \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow>\<^sub>D G\<close>
and \<open>R\<^sub>2 |: G \<^sub>1\<^sub>-\<^sub>1\<longleftrightarrow>\<^sub>D H\<close>
using "equi:3"[THEN "\<equiv>\<^sub>d\<^sub>fE"] "&E" "\<exists>E"[rotated] by metis
AOT_hence \<theta>: \<open>\<forall>u ([F]u \<rightarrow> \<exists>!v([G]v & [R\<^sub>1]uv)) & \<forall>v ([G]v \<rightarrow> \<exists>!u([F]u & [R\<^sub>1]uv))\<close>
and \<xi>: \<open>\<forall>u ([G]u \<rightarrow> \<exists>!v([H]v & [R\<^sub>2]uv)) & \<forall>v ([H]v \<rightarrow> \<exists>!u([G]u & [R\<^sub>2]uv))\<close>
using "equi:2"[THEN "\<equiv>\<^sub>d\<^sub>fE", THEN "&E"(2)]
"equi:2"[THEN "\<equiv>\<^sub>d\<^sub>fE", THEN "&E"(1), THEN "&E"(2)]
"&I" by blast+
AOT_have \<open>\<exists>R R = [\<lambda>xy D!x & D!y & \<exists>v ([G]v & [R\<^sub>1]xv & [R\<^sub>2]vy)]\<close>
by (rule "free-thms:3[lambda]") cqt_2_lambda_inst_prover
then AOT_obtain R where R_def: \<open>R = [\<lambda>xy D!x & D!y & \<exists>v ([G]v & [R\<^sub>1]xv & [R\<^sub>2]vy)]\<close>
using "\<exists>E"[rotated] by blast
AOT_have 1: \<open>\<exists>!v (([H]v & [R]uv))\<close> if a: \<open>[D!]u\<close> and b: \<open>[F]u\<close> for u
proof (rule "\<equiv>E"(2)[OF "equi:1"])
AOT_obtain b where
b_prop: \<open>[D!]b & ([G]b & [R\<^sub>1]ub & \<forall>v ([G]v & [R\<^sub>1]uv \<rightarrow> v =\<^sub>D b))\<close>
using \<theta>[THEN "&E"(1), THEN "\<forall>E"(2), THEN "\<rightarrow>E", THEN "\<rightarrow>E",
OF a b, THEN "\<equiv>E"(1)[OF "equi:1"]]
"\<exists>E"[rotated] by blast
AOT_obtain c where
c_prop: "[D!]c & ([H]c & [R\<^sub>2]bc & \<forall>v ([H]v & [R\<^sub>2]bv \<rightarrow> v =\<^sub>D c))"
using \<xi>[THEN "&E"(1), THEN "\<forall>E"(2)[where \<beta>=b], THEN "\<rightarrow>E",
OF b_prop[THEN "&E"(1)], THEN "\<rightarrow>E",
OF b_prop[THEN "&E"(2), THEN "&E"(1), THEN "&E"(1)],
THEN "\<equiv>E"(1)[OF "equi:1"]]
"\<exists>E"[rotated] by blast
AOT_show \<open>\<exists>v ([H]v & [R]uv & \<forall>v' ([H]v' & [R]uv' \<rightarrow> v' =\<^sub>D v))\<close>
proof (safe intro!: "&I" GEN "\<rightarrow>I" "\<exists>I"(2)[where \<beta>=c])
AOT_show \<open>D!c\<close> using c_prop "&E" by blast
next
AOT_show \<open>[H]c\<close> using c_prop "&E" by blast
next
AOT_have 0: \<open>[D!]u & [D!]c & \<exists>v ([G]v & [R\<^sub>1]uv & [R\<^sub>2]vc)\<close>
by (safe intro!: "&I" a c_prop[THEN "&E"(1)] "\<exists>I"(2)[where \<beta>=b]
b_prop[THEN "&E"(1)] b_prop[THEN "&E"(2), THEN "&E"(1)]
c_prop[THEN "&E"(2), THEN "&E"(1), THEN "&E"(2)])
AOT_show \<open>[R]uc\<close>
by (auto intro: "rule=E"[rotated, OF R_def[symmetric]]
intro!: "\<beta>\<leftarrow>C"(1) "cqt:2"
simp: "&I" "ex:1:a" prod_denotesI "rule-ui:3" 0)
next
fix x
AOT_assume ordx: \<open>D!x\<close>
AOT_assume \<open>[H]x & [R]ux\<close>
AOT_hence hx: \<open>[H]x\<close> and \<open>[R]ux\<close> using "&E" by blast+
AOT_hence \<open>[\<lambda>xy D!x & D!y & \<exists>v ([G]v & [R\<^sub>1]xv & [R\<^sub>2]vy)]ux\<close>
using "rule=E"[rotated, OF R_def] by fast
AOT_hence \<open>D!u & D!x & \<exists>v ([G]v & [R\<^sub>1]uv & [R\<^sub>2]vx)\<close>
by (rule "\<beta>\<rightarrow>C"(1)[where \<phi>="\<lambda>(\<kappa>,\<kappa>'). _ \<kappa> \<kappa>'" and \<kappa>\<^sub>1\<kappa>\<^sub>n="(_,_)", simplified])
then AOT_obtain z where z_prop: \<open>D!z & ([G]z & [R\<^sub>1]uz & [R\<^sub>2]zx)\<close>
using "&E" "\<exists>E"[rotated] by blast
AOT_hence \<open>z =\<^sub>D b\<close>
using b_prop[THEN "&E"(2), THEN "&E"(2), THEN "\<forall>E"(2)[where \<beta>=z]]
using "&E" "\<rightarrow>E" by metis
AOT_hence \<open>z = b\<close>
using "cqt:2"(1) "discern-obj:18.unvarify_x.unvarify_y.\<forall>E(1).\<forall>E(1).\<equiv>E(1).&E(2).rule=E'" "rule=I:1" by blast
AOT_hence \<open>[R\<^sub>2]bx\<close>
using z_prop[THEN "&E"(2), THEN "&E"(2)] "rule=E" by fast