roseking commited on
Commit
3277efa
·
verified ·
1 Parent(s): e3e0a0d

Sync from openai/math@faee2cf485a8 (part 25)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. lean/OAI/SetTheory/PartitionPrinciple/Definability/GroundTaggedComponentGraphs.lean +84 -84
  2. lean/OAI/SetTheory/PartitionPrinciple/Definability/GroundVaryingPreparationRelations.lean +448 -448
  3. lean/OAI/SetTheory/PartitionPrinciple/Definability/HistoryFieldFormulas.lean +124 -124
  4. lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedAttachmentCodes.lean +228 -228
  5. lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedMixedOperationLiftCodes.lean +58 -58
  6. lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedOperationLiftCodes.lean +86 -86
  7. lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedSubstructureCodes.lean +122 -122
  8. lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedValueLiftCodes.lean +60 -60
  9. lean/OAI/SetTheory/PartitionPrinciple/Definability/InitialMainAlgebraCodes.lean +202 -202
  10. lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalEmbeddingFormulas.lean +67 -67
  11. lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalHeightFormulas.lean +62 -62
  12. lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalSequenceFormulas.lean +277 -277
  13. lean/OAI/SetTheory/PartitionPrinciple/Definability/LeastSlotOwnerCodes.lean +248 -248
  14. lean/OAI/SetTheory/PartitionPrinciple/Definability/LiftedCompressionFormulas.lean +118 -118
  15. lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedMainInvariantCodes.lean +68 -68
  16. lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedMainTransitionRawCodes.lean +177 -177
  17. lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedProfileTransitionRawCodes.lean +113 -113
  18. lean/OAI/SetTheory/PartitionPrinciple/Definability/MainLimitCoverageFormulas.lean +559 -559
  19. lean/OAI/SetTheory/PartitionPrinciple/Definability/MainPrefixTraceStepFormulas.lean +164 -164
  20. lean/OAI/SetTheory/PartitionPrinciple/Definability/MainPrefixValidityFormulas.lean +241 -241
  21. lean/OAI/SetTheory/PartitionPrinciple/Definability/MainTransitionValidityCodes.lean +131 -131
  22. lean/OAI/SetTheory/PartitionPrinciple/Definability/MapFamilyApplicationGraphs.lean +373 -373
  23. lean/OAI/SetTheory/PartitionPrinciple/Definability/NameSupportFormulas.lean +74 -74
  24. lean/OAI/SetTheory/PartitionPrinciple/Definability/NatUnionCodes.lean +373 -373
  25. lean/OAI/SetTheory/PartitionPrinciple/Definability/NaturalSetCodes.lean +149 -149
  26. lean/OAI/SetTheory/PartitionPrinciple/Definability/NaturalStepFormulas.lean +259 -259
  27. lean/OAI/SetTheory/PartitionPrinciple/Definability/NonemptyTupleFields.lean +482 -482
  28. lean/OAI/SetTheory/PartitionPrinciple/Definability/OrbitImageFormulas.lean +93 -93
  29. lean/OAI/SetTheory/PartitionPrinciple/Definability/PairPushFilterFamilies.lean +148 -148
  30. lean/OAI/SetTheory/PartitionPrinciple/Definability/ParentSupportCodes.lean +632 -632
  31. lean/OAI/SetTheory/PartitionPrinciple/Definability/PartitionPrincipleFormula.lean +50 -50
  32. lean/OAI/SetTheory/PartitionPrinciple/Definability/PreparedCertificateCodes.lean +181 -181
  33. lean/OAI/SetTheory/PartitionPrinciple/Definability/PresentedGroupCodes.lean +688 -688
  34. lean/OAI/SetTheory/PartitionPrinciple/Definability/PresentedRowAssignmentGraphs.lean +70 -70
  35. lean/OAI/SetTheory/PartitionPrinciple/Definability/PreservedMainPrefixHistoryFormulas.lean +428 -428
  36. lean/OAI/SetTheory/PartitionPrinciple/Definability/PrincipalSupportFormulas.lean +76 -76
  37. lean/OAI/SetTheory/PartitionPrinciple/Definability/PrincipalTileRealization.lean +75 -75
  38. lean/OAI/SetTheory/PartitionPrinciple/Definability/RationalCodeLaws.lean +169 -169
  39. lean/OAI/SetTheory/PartitionPrinciple/Definability/RawCheckFormulas.lean +123 -123
  40. lean/OAI/SetTheory/PartitionPrinciple/Definability/RawRenameFormulas.lean +141 -141
  41. lean/OAI/SetTheory/PartitionPrinciple/Definability/RecursiveActionRealization.lean +227 -227
  42. lean/OAI/SetTheory/PartitionPrinciple/Definability/RecursivePrimitiveFormulas.lean +114 -114
  43. lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementDataHistoryEntryFormulas.lean +108 -108
  44. lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementHistoryOrderOutputFormulas.lean +180 -180
  45. lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementIndexActionFormulas.lean +60 -60
  46. lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementValidityCodes.lean +77 -77
  47. lean/OAI/SetTheory/PartitionPrinciple/Definability/RenamedEntryFormulas.lean +137 -137
  48. lean/OAI/SetTheory/PartitionPrinciple/Definability/RepresentativeProductAgreement.lean +120 -120
  49. lean/OAI/SetTheory/PartitionPrinciple/Definability/RootedSupportOwnerFunction.lean +59 -59
  50. lean/OAI/SetTheory/PartitionPrinciple/Definability/RowAssignmentCutGraphLaws.lean +87 -87
lean/OAI/SetTheory/PartitionPrinciple/Definability/GroundTaggedComponentGraphs.lean CHANGED
@@ -1,84 +1,84 @@
1
- import OAI.SetTheory.PartitionPrinciple.Geometry.GroundAttachmentEmbeddings
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
- open SetFormula
9
- universe u
10
-
11
- noncomputable def taggedComponentGraph (P I B N : ZFSet.{u}) : ZFSet.{u} :=
12
- ZFSet.sep (fun z => ∃ x ∈ ZFSet.prod {P} N, ∃ i ∈ I, ∃ n ∈ N, ∃ q ∈ B,
13
- z = ZFSet.pair x i ∧ x = ZFSet.pair P n ∧ n = ZFSet.pair i q)
14
- (ZFSet.prod (ZFSet.prod {P} N) I)
15
-
16
- theorem pair_mem_taggedComponentGraph (P I B N x i : ZFSet.{u}) :
17
- ZFSet.pair x i ∈ taggedComponentGraph P I B N ↔
18
- i ∈ I ∧ ∃ q ∈ B, ZFSet.pair i q ∈ N ∧ x = ZFSet.pair P (ZFSet.pair i q) := by
19
- rw [taggedComponentGraph, ZFSet.mem_sep]
20
- constructor
21
- · rintro ⟨_, y, _, j, hj, n, hn, q, hq, equal, value, rfl⟩
22
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
23
- exact ⟨hj, q, hq, hn, value⟩
24
- · rintro ⟨hi, q, hq, hn, rfl⟩
25
- have hx : ZFSet.pair P (ZFSet.pair i q) ∈ ZFSet.prod {P} N := ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hn⟩
26
- exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hi⟩, _, hx, i, hi, _, hn, q, hq, rfl, rfl, rfl⟩
27
-
28
- theorem taggedComponentGraph_function {P I B N : ZFSet.{u}} (subset : N ⊆ ZFSet.prod I B) :
29
- ZFSet.IsFunc (ZFSet.prod {P} N) I (taggedComponentGraph P I B N) := by
30
- refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩
31
- intro x hx
32
- obtain ⟨p, hp, n, hn, rfl⟩ := ZFSet.mem_prod.1 hx
33
- obtain rfl := ZFSet.mem_singleton.1 hp
34
- obtain ⟨i, hi, q, hq, rfl⟩ := ZFSet.mem_prod.1 (subset hn)
35
- refine ⟨i, (pair_mem_taggedComponentGraph _ _ _ _ _ _).2 ⟨hi, q, hq, hn, rfl⟩, ?_⟩
36
- intro j hj
37
- obtain ⟨_, r, _, _, equal⟩ := (pair_mem_taggedComponentGraph _ _ _ _ _ _).1 hj
38
- exact ((ZFSet.pair_inj.1 ((ZFSet.pair_inj.1 equal).2)).1).symm
39
-
40
- namespace BoundedFormula
41
-
42
- def taggedComponentFormula : BoundedFormula 6 :=
43
- exMem 1 (exMem 3 (exMem 5 (exMem 7
44
- (.conj (orderedPairFormula 4 3 2)
45
- (.conj (orderedPairFormula 3 9 1) (orderedPairFormula 1 2 0))))))
46
-
47
- theorem truth_taggedComponentFormula (env : Fin 6 → ZFSet.{u}) :
48
- Truth taggedComponentFormula env ↔
49
- ∃ x ∈ env 1, ∃ i ∈ env 2, ∃ n ∈ env 3, ∃ q ∈ env 4,
50
- env 0 = ZFSet.pair x i ∧ x = ZFSet.pair (env 5) n ∧ n = ZFSet.pair i q := by
51
- simp only [taggedComponentFormula, truth_exMem, Truth, truth_orderedPairFormula]
52
- rfl
53
- end BoundedFormula
54
-
55
- namespace TransitiveGround
56
- variable (M : TransitiveGround.{u})
57
-
58
- theorem taggedComponentGraph_mem
59
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
60
- (unions : Realize M.sets SetFormula.union Fin.elim0)
61
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
62
- {P I B N : ZFSet.{u}} (hP : P ∈ M.sets) (hI : I ∈ M.sets)
63
- (hB : B ∈ M.sets) (hN : N ∈ M.sets) : taggedComponentGraph P I B N ∈ M.sets := by
64
- have hSingle : ({P} : ZFSet.{u}) ∈ M.sets := by
65
- simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP
66
- have hF := M.prod_mem pairing unions powers separation hSingle hN
67
- let params := extend (ZFSet.prod {P} N) (extend I (extend N (extend B (extend P Fin.elim0))))
68
- have selected := M.bounded_separation_mem separation BoundedFormula.taggedComponentFormula params
69
- (Fin.cases hF (Fin.cases hI (Fin.cases hN (Fin.cases hB (Fin.cases hP (fun j => Fin.elim0 j))))))
70
- (M.prod_mem pairing unions powers separation hF hI)
71
- have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.taggedComponentFormula
72
- (extend z params)) (ZFSet.prod (ZFSet.prod {P} N) I) = taggedComponentGraph P I B N := by
73
- apply ZFSet.ext
74
- intro z
75
- rw [ZFSet.mem_sep, taggedComponentGraph, ZFSet.mem_sep]
76
- exact and_congr Iff.rfl (BoundedFormula.truth_taggedComponentFormula _)
77
- exact equal ▸ selected
78
- end TransitiveGround
79
-
80
- end PartitionPilot.Forcing
81
-
82
- end
83
-
84
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Geometry.GroundAttachmentEmbeddings
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+ open SetFormula
9
+ universe u
10
+
11
+ noncomputable def taggedComponentGraph (P I B N : ZFSet.{u}) : ZFSet.{u} :=
12
+ ZFSet.sep (fun z => ∃ x ∈ ZFSet.prod {P} N, ∃ i ∈ I, ∃ n ∈ N, ∃ q ∈ B,
13
+ z = ZFSet.pair x i ∧ x = ZFSet.pair P n ∧ n = ZFSet.pair i q)
14
+ (ZFSet.prod (ZFSet.prod {P} N) I)
15
+
16
+ theorem pair_mem_taggedComponentGraph (P I B N x i : ZFSet.{u}) :
17
+ ZFSet.pair x i ∈ taggedComponentGraph P I B N ↔
18
+ i ∈ I ∧ ∃ q ∈ B, ZFSet.pair i q ∈ N ∧ x = ZFSet.pair P (ZFSet.pair i q) := by
19
+ rw [taggedComponentGraph, ZFSet.mem_sep]
20
+ constructor
21
+ · rintro ⟨_, y, _, j, hj, n, hn, q, hq, equal, value, rfl⟩
22
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
23
+ exact ⟨hj, q, hq, hn, value⟩
24
+ · rintro ⟨hi, q, hq, hn, rfl⟩
25
+ have hx : ZFSet.pair P (ZFSet.pair i q) ∈ ZFSet.prod {P} N := ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_singleton.2 rfl, hn⟩
26
+ exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hi⟩, _, hx, i, hi, _, hn, q, hq, rfl, rfl, rfl⟩
27
+
28
+ theorem taggedComponentGraph_function {P I B N : ZFSet.{u}} (subset : N ⊆ ZFSet.prod I B) :
29
+ ZFSet.IsFunc (ZFSet.prod {P} N) I (taggedComponentGraph P I B N) := by
30
+ refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩
31
+ intro x hx
32
+ obtain ⟨p, hp, n, hn, rfl⟩ := ZFSet.mem_prod.1 hx
33
+ obtain rfl := ZFSet.mem_singleton.1 hp
34
+ obtain ⟨i, hi, q, hq, rfl⟩ := ZFSet.mem_prod.1 (subset hn)
35
+ refine ⟨i, (pair_mem_taggedComponentGraph _ _ _ _ _ _).2 ⟨hi, q, hq, hn, rfl⟩, ?_⟩
36
+ intro j hj
37
+ obtain ⟨_, r, _, _, equal⟩ := (pair_mem_taggedComponentGraph _ _ _ _ _ _).1 hj
38
+ exact ((ZFSet.pair_inj.1 ((ZFSet.pair_inj.1 equal).2)).1).symm
39
+
40
+ namespace BoundedFormula
41
+
42
+ def taggedComponentFormula : BoundedFormula 6 :=
43
+ exMem 1 (exMem 3 (exMem 5 (exMem 7
44
+ (.conj (orderedPairFormula 4 3 2)
45
+ (.conj (orderedPairFormula 3 9 1) (orderedPairFormula 1 2 0))))))
46
+
47
+ theorem truth_taggedComponentFormula (env : Fin 6 → ZFSet.{u}) :
48
+ Truth taggedComponentFormula env ↔
49
+ ∃ x ∈ env 1, ∃ i ∈ env 2, ∃ n ∈ env 3, ∃ q ∈ env 4,
50
+ env 0 = ZFSet.pair x i ∧ x = ZFSet.pair (env 5) n ∧ n = ZFSet.pair i q := by
51
+ simp only [taggedComponentFormula, truth_exMem, Truth, truth_orderedPairFormula]
52
+ rfl
53
+ end BoundedFormula
54
+
55
+ namespace TransitiveGround
56
+ variable (M : TransitiveGround.{u})
57
+
58
+ theorem taggedComponentGraph_mem
59
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
60
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
61
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
62
+ {P I B N : ZFSet.{u}} (hP : P ∈ M.sets) (hI : I ∈ M.sets)
63
+ (hB : B ∈ M.sets) (hN : N ∈ M.sets) : taggedComponentGraph P I B N ∈ M.sets := by
64
+ have hSingle : ({P} : ZFSet.{u}) ∈ M.sets := by
65
+ simpa only [ZFSet.pair_eq_singleton] using M.unorderedPair_mem pairing hP hP
66
+ have hF := M.prod_mem pairing unions powers separation hSingle hN
67
+ let params := extend (ZFSet.prod {P} N) (extend I (extend N (extend B (extend P Fin.elim0))))
68
+ have selected := M.bounded_separation_mem separation BoundedFormula.taggedComponentFormula params
69
+ (Fin.cases hF (Fin.cases hI (Fin.cases hN (Fin.cases hB (Fin.cases hP (fun j => Fin.elim0 j))))))
70
+ (M.prod_mem pairing unions powers separation hF hI)
71
+ have equal : ZFSet.sep (fun z => BoundedFormula.Truth BoundedFormula.taggedComponentFormula
72
+ (extend z params)) (ZFSet.prod (ZFSet.prod {P} N) I) = taggedComponentGraph P I B N := by
73
+ apply ZFSet.ext
74
+ intro z
75
+ rw [ZFSet.mem_sep, taggedComponentGraph, ZFSet.mem_sep]
76
+ exact and_congr Iff.rfl (BoundedFormula.truth_taggedComponentFormula _)
77
+ exact equal ▸ selected
78
+ end TransitiveGround
79
+
80
+ end PartitionPilot.Forcing
81
+
82
+ end
83
+
84
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/GroundVaryingPreparationRelations.lean CHANGED
@@ -1,448 +1,448 @@
1
- import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNicePreparationWitnessBounds
2
- import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralHistoryTestUnions
3
-
4
- namespace OAI
5
-
6
-
7
-
8
- namespace PartitionPilot.Forcing.TransitiveGround
9
- open SetFormula
10
- universe u
11
- variable (M : TransitiveGround.{u})
12
-
13
- def StoredPreparationCode (upperOrder cutGraph meet omega C E : ZFSet.{u})
14
- (fields : Fin 15 → ZFSet.{u}) (p y : ZFSet.{u}) : Prop :=
15
- ∃ row A r k enumerations q,
16
- p = ZFSet.pair row A ∧ y = ZFSet.pair r (ZFSet.pair k enumerations) ∧
17
- ZFSet.pair r p ∈ upperOrder ∧ ZFSet.pair r q ∈ cutGraph ∧
18
- PreparedCertificateFamilyCode M (fields 7) (fields 8) q (fields 10) (fields 11)
19
- meet (fields 14) (fields 13) (fields 9) omega (M.storedPreparationRequests A fields)
20
- C E k enumerations
21
-
22
- private def transitionShape {n} (p y upperOrder cutGraph : Fin n) : BoundedFormula (n + 8) :=
23
- let old := suffixIndex n 8
24
- let v := prefixIndex n 8
25
- .conj (BoundedFormula.orderedPairFormula (old p) (v 0) (v 1))
26
- (.conj (BoundedFormula.orderedPairFormula (old y) (v 2) (v 5))
27
- (.conj (BoundedFormula.orderedPairFormula (v 5) (v 3) (v 4))
28
- (.conj (BoundedFormula.pairMembershipFormula (v 2) (old p) (old upperOrder))
29
- (BoundedFormula.pairMembershipFormula (v 2) (v 6) (old cutGraph)))))
30
-
31
- variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
32
- variable (unions : Realize M.sets SetFormula.union Fin.elim0)
33
- variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
34
-
35
- private noncomputable def transitionBody {n}
36
- (p y upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n) : SetFormula (n + 8) :=
37
- let old := suffixIndex n 8
38
- let v := prefixIndex n 8
39
- .conj (transitionShape p y upperOrder cutGraph).toFormula
40
- (.conj (SetFormula.reindex (extend (v 7) (extend (v 1) (fun j => old (fields j))))
41
- (M.definable_storedPreparationRequests pairing unions powers separation).formula)
42
- (preparedCertificateFamilyFormula (old (fields 7)) (old (fields 8)) (v 6)
43
- (old (fields 10)) (old (fields 11)) (old meet) (old (fields 14))
44
- (old (fields 13)) (old (fields 9)) (old omega) (v 7) (old C) (old E) (v 3) (v 4)))
45
-
46
- noncomputable def storedPreparationFormula {n}
47
- (p y upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n) : SetFormula n :=
48
- exBlock 8 (transitionBody M pairing unions powers separation p y upperOrder cutGraph meet omega C E fields)
49
-
50
- theorem realize_storedPreparationFormula {n}
51
- (p y upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n)
52
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
53
- (meetCode : MeetOrderCode (env (fields 10)) (env (fields 11)) (env meet)) :
54
- Realize M.sets (M.storedPreparationFormula pairing unions powers separation
55
- p y upperOrder cutGraph meet omega C E fields) env ↔
56
- M.StoredPreparationCode (env upperOrder) (env cutGraph) (env meet) (env omega)
57
- (env C) (env E) (fun j => env (fields j)) (env p) (env y) := by
58
- unfold storedPreparationFormula
59
- rw [realize_exBlock]
60
- have actual (w : Fin 8 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) :
61
- Realize M.sets (transitionBody M pairing unions powers separation
62
- p y upperOrder cutGraph meet omega C E fields) (extendMany 8 w env) ↔
63
- (env p = ZFSet.pair (w 0) (w 1) ∧ env y = ZFSet.pair (w 2) (w 5) ∧
64
- w 5 = ZFSet.pair (w 3) (w 4) ∧ ZFSet.pair (w 2) (env p) ∈ env upperOrder ∧
65
- ZFSet.pair (w 2) (w 6) ∈ env cutGraph) ∧
66
- w 7 = M.storedPreparationRequests (w 1) (fun j => env (fields j)) ∧
67
- PreparedCertificateFamilyCode M (env (fields 7)) (env (fields 8)) (w 6)
68
- (env (fields 10)) (env (fields 11)) (env meet) (env (fields 14))
69
- (env (fields 13)) (env (fields 9)) (env omega) (w 7) (env C) (env E) (w 3) (w 4) := by
70
- have allGround := extendMany_members 8 w env ground members
71
- dsimp only [transitionBody]
72
- rw [Realize, Realize, BoundedFormula.realize_toFormula M _ _ allGround]
73
- have request : Realize M.sets (SetFormula.reindex
74
- (extend (prefixIndex n 8 7) (extend (prefixIndex n 8 1)
75
- (fun j => suffixIndex n 8 (fields j))))
76
- (M.definable_storedPreparationRequests pairing unions powers separation).formula)
77
- (extendMany 8 w env) ↔
78
- w 7 = M.storedPreparationRequests (w 1) (fun j => env (fields j)) := by
79
- rw [realize_reindex, map_extend, map_extend]
80
- simp only [extendMany_prefix, extendMany_suffix]
81
- exact (M.definable_storedPreparationRequests pairing unions powers separation).correct
82
- (extend (w 1) (fun j => env (fields j)))
83
- (Fin.cases (ground 1) (fun j => members (fields j))) (w 7) (ground 7)
84
- rw [request, M.realize_preparedCertificateFamilyFormula _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
85
- _ allGround (by simpa only [extendMany_suffix] using meetCode)]
86
- simp only [transitionShape, BoundedFormula.Truth, BoundedFormula.truth_orderedPairFormula,
87
- BoundedFormula.truth_pairMembershipFormula, extendMany_prefix, extendMany_suffix]
88
- constructor
89
- · rintro ⟨w, ground, body⟩
90
- obtain ⟨⟨input, output, tail, below, cut⟩, requests, prepared⟩ := (actual w ground).1 body
91
- exact ⟨w 0, w 1, w 2, w 3, w 4, w 6, input, tail ▸ output, below, cut, requests ▸ prepared⟩
92
- · rintro ⟨row, A, r, k, enumerations, q, input, output, below, cut, prepared⟩
93
- have hp := input ▸ members p
94
- have hy := output ▸ members y
95
- have hTail := M.pair_right hy
96
- have hq := M.pair_right (M.transitive (members cutGraph) cut)
97
- let J := M.storedPreparationRequests A (fun j => env (fields j))
98
- have hJ := M.storedPreparationRequests_mem pairing unions powers separation (M.pair_right hp)
99
- (fun j => env (fields j)) (fun j => members (fields j))
100
- let w : Fin 8 → ZFSet.{u} := ![row, A, r, k, enumerations, ZFSet.pair k enumerations, q, J]
101
- have ground : ∀ j, w j ∈ M.sets := Fin.cases (M.pair_left hp)
102
- (Fin.cases (M.pair_right hp) (Fin.cases (M.pair_left hy)
103
- (Fin.cases (M.pair_left hTail) (Fin.cases (M.pair_right hTail)
104
- (Fin.cases hTail (Fin.cases hq (Fin.cases hJ (fun j => Fin.elim0 j))))))))
105
- exact ⟨w, ground, (actual w ground).2 ⟨⟨input, output, rfl, below, cut⟩, rfl, prepared⟩⟩
106
-
107
- end PartitionPilot.Forcing.TransitiveGround
108
-
109
-
110
-
111
-
112
- namespace PartitionPilot.Forcing.TransitiveGround
113
- open SetFormula
114
- universe u
115
- variable (M : TransitiveGround.{u})
116
-
117
- noncomputable def storedPreparationRelation
118
- (Q upperOrder nodes T levels alpha meet : ZFSet.{u}) (fields : Fin 15 → ZFSet.{u}) : ZFSet.{u} :=
119
- let W := M.groundRelations T Q
120
- let C := M.supportedEqualityCertificateBound nodes W
121
- let E := M.synchronizedEnumerationBound nodes W
122
- let cut := rowAssignmentCutGraph Q (fields 7) levels alpha
123
- ZFSet.sep (fun z => ∃ p y, z = ZFSet.pair p y ∧
124
- M.StoredPreparationCode upperOrder cut meet ZFSet.omega C E fields p y)
125
- (ZFSet.prod Q (M.preparationWitnessBound nodes T Q))
126
-
127
- theorem pair_mem_storedPreparationRelation
128
- (Q upperOrder nodes T levels alpha meet : ZFSet.{u}) (fields : Fin 15 → ZFSet.{u})
129
- (p y : ZFSet.{u}) :
130
- ZFSet.pair p y ∈ M.storedPreparationRelation Q upperOrder nodes T levels alpha meet fields ↔
131
- p ∈ Q ∧ y ∈ M.preparationWitnessBound nodes T Q ∧
132
- M.StoredPreparationCode upperOrder (rowAssignmentCutGraph Q (fields 7) levels alpha)
133
- meet ZFSet.omega (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q))
134
- (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) fields p y := by
135
- rw [storedPreparationRelation, ZFSet.mem_sep, ZFSet.pair_mem_prod]
136
- constructor
137
- · rintro ⟨⟨hp, hy⟩, p', y', eq, code⟩
138
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq
139
- exact ⟨hp, hy, code⟩
140
- · rintro ⟨hp, hy, code⟩
141
- exact ⟨⟨hp, hy⟩, p, y, rfl, code⟩
142
-
143
- variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
144
- variable (unions : Realize M.sets SetFormula.union Fin.elim0)
145
- variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
146
-
147
- private noncomputable def preparationEntryFormula {n}
148
- (z upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n) : SetFormula n :=
149
- let old := suffixIndex n 2
150
- let v := prefixIndex n 2
151
- exBlock 2 (.conj (BoundedFormula.orderedPairFormula (old z) (v 0) (v 1)).toFormula
152
- (M.storedPreparationFormula pairing unions powers separation
153
- (v 0) (v 1) (old upperOrder) (old cutGraph) (old meet) (old omega) (old C) (old E)
154
- (fun j => old (fields j))))
155
-
156
- private theorem realize_preparationEntryFormula {n}
157
- (z upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n)
158
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
159
- (meetCode : MeetOrderCode (env (fields 10)) (env (fields 11)) (env meet)) :
160
- Realize M.sets (preparationEntryFormula M pairing unions powers separation
161
- z upperOrder cutGraph meet omega C E fields) env ↔
162
- ∃ p y, env z = ZFSet.pair p y ∧
163
- M.StoredPreparationCode (env upperOrder) (env cutGraph) (env meet) (env omega)
164
- (env C) (env E) (fun j => env (fields j)) p y := by
165
- unfold preparationEntryFormula
166
- rw [realize_exBlock]
167
- have actual (w : Fin 2 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) :
168
- Realize M.sets (.conj
169
- (BoundedFormula.orderedPairFormula (suffixIndex n 2 z)
170
- (prefixIndex n 2 0) (prefixIndex n 2 1)).toFormula
171
- (M.storedPreparationFormula pairing unions powers separation
172
- (prefixIndex n 2 0) (prefixIndex n 2 1) (suffixIndex n 2 upperOrder)
173
- (suffixIndex n 2 cutGraph) (suffixIndex n 2 meet) (suffixIndex n 2 omega)
174
- (suffixIndex n 2 C) (suffixIndex n 2 E) (fun j => suffixIndex n 2 (fields j))))
175
- (extendMany 2 w env) ↔
176
- env z = ZFSet.pair (w 0) (w 1) ∧
177
- M.StoredPreparationCode (env upperOrder) (env cutGraph) (env meet) (env omega)
178
- (env C) (env E) (fun j => env (fields j)) (w 0) (w 1) := by
179
- have allGround := extendMany_members 2 w env ground members
180
- rw [Realize, BoundedFormula.realize_toFormula M _ _ allGround,
181
- BoundedFormula.truth_orderedPairFormula,
182
- M.realize_storedPreparationFormula pairing unions powers separation
183
- _ _ _ _ _ _ _ _ _ _ allGround (by simpa only [extendMany_suffix] using meetCode)]
184
- simp only [extendMany_prefix, extendMany_suffix]
185
- constructor
186
- · rintro ⟨w, ground, body⟩
187
- exact ⟨w 0, w 1, (actual w ground).1 body⟩
188
- · rintro ⟨p, y, equal, code⟩
189
- have hp := M.pair_left (equal ▸ members z)
190
- have hy := M.pair_right (equal ▸ members z)
191
- exact ⟨![p, y], Fin.cases hp (Fin.cases hy (fun j => Fin.elim0 j)),
192
- (actual ![p, y] (Fin.cases hp (Fin.cases hy (fun j => Fin.elim0 j)))).2 ⟨equal, code⟩⟩
193
-
194
- include pairing unions powers separation in
195
- theorem storedPreparationRelation_mem
196
- {Q upperOrder nodes T levels alpha meet : ZFSet.{u}}
197
- (hQ : Q ∈ M.sets) (hOrder : upperOrder ∈ M.sets) (hNodes : nodes ∈ M.sets)
198
- (hT : T ∈ M.sets) (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets)
199
- (hMeet : meet ∈ M.sets) (omega : ZFSet.omega ∈ M.sets)
200
- (fields : Fin 15 → ZFSet.{u}) (members : ∀ j, fields j ∈ M.sets)
201
- (meetCode : MeetOrderCode (fields 10) (fields 11) meet) :
202
- M.storedPreparationRelation Q upperOrder nodes T levels alpha meet fields ∈ M.sets := by
203
- let W := M.groundRelations T Q
204
- let C := M.supportedEqualityCertificateBound nodes W
205
- let E := M.synchronizedEnumerationBound nodes W
206
- let cut := rowAssignmentCutGraph Q (fields 7) levels alpha
207
- have hW := M.groundRelations_mem pairing unions powers separation hT hQ
208
- have hC := M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hW omega
209
- have hE := M.synchronizedEnumerationBound_mem pairing unions powers separation hNodes hW omega
210
- have hCut := M.rowAssignmentCutGraph_mem pairing unions powers separation hQ (members 7) hLevels hAlpha
211
- let params : Fin 21 → ZFSet.{u} :=
212
- extend upperOrder (extend cut (extend meet (extend ZFSet.omega (extend C (extend E fields)))))
213
- have ground : ∀ j, params j ∈ M.sets := Fin.cases hOrder (Fin.cases hCut
214
- (Fin.cases hMeet (Fin.cases omega (Fin.cases hC (Fin.cases hE members)))))
215
- let slots : Fin 15 → Fin 22 := fun j => j.succ.succ.succ.succ.succ.succ.succ
216
- let formula := preparationEntryFormula M pairing unions powers separation 0 1 2 3 4 5 6 slots
217
- have bound := M.prod_mem pairing unions powers separation hQ
218
- (M.preparationWitnessBound_mem pairing unions powers separation hNodes hT hQ omega)
219
- have selected := M.separation_mem separation formula params ground bound
220
- have equal : ZFSet.sep (fun z => Realize M.sets formula (extend z params))
221
- (ZFSet.prod Q (M.preparationWitnessBound nodes T Q)) =
222
- M.storedPreparationRelation Q upperOrder nodes T levels alpha meet fields := by
223
- apply ZFSet.ext
224
- intro z
225
- rw [ZFSet.mem_sep, storedPreparationRelation, ZFSet.mem_sep]
226
- apply and_congr_right
227
- intro hz
228
- exact realize_preparationEntryFormula M pairing unions powers separation 0 1 2 3 4 5 6 slots
229
- (extend z params) (Fin.cases (M.transitive bound hz) ground) meetCode
230
- exact equal ▸ selected
231
-
232
- end PartitionPilot.Forcing.TransitiveGround
233
-
234
-
235
-
236
-
237
- namespace PartitionPilot.Forcing.TransitiveGround
238
- open SetFormula
239
- universe u
240
- variable (M : TransitiveGround.{u})
241
-
242
- def VaryingPreparationCode (packed Q upperOrder nodes T levels omega C E z : ZFSet.{u}) : Prop :=
243
- ∃ alpha p y, ∃ fields : Fin 15 → ZFSet.{u},
244
- z = ZFSet.pair (ZFSet.pair alpha p) y ∧
245
- ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧
246
- fields 6 = T ∧ fields 10 = nodes ∧
247
- MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧
248
- M.StoredPreparationCode upperOrder (rowAssignmentCutGraph Q (fields 7) levels alpha)
249
- (canonicalMeetGraph (fields 10) (fields 11)) omega C E fields p y
250
-
251
- theorem varyingPreparationCode_pair_iff (packed Q upperOrder nodes T levels omega C E alpha p y : ZFSet.{u}) :
252
- M.VaryingPreparationCode packed Q upperOrder nodes T levels omega C E
253
- (ZFSet.pair (ZFSet.pair alpha p) y) ↔
254
- ∃ fields : Fin 15 → ZFSet.{u},
255
- ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧
256
- fields 6 = T ∧ fields 10 = nodes ∧
257
- MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧
258
- M.StoredPreparationCode upperOrder (rowAssignmentCutGraph Q (fields 7) levels alpha)
259
- (canonicalMeetGraph (fields 10) (fields 11)) omega C E fields p y := by
260
- constructor
261
- · rintro ⟨alpha', p', y', fields, equal, rest⟩
262
- obtain ⟨input, rfl⟩ := ZFSet.pair_inj.1 equal
263
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 input
264
- exact ⟨fields, rest⟩
265
- · rintro ⟨fields, rest⟩
266
- exact ⟨alpha, p, y, fields, rfl, rest⟩
267
-
268
- private def varyingShape {n} (z packed nodes T : Fin n) : BoundedFormula (n + 22) :=
269
- let old := suffixIndex n 22
270
- let v := prefixIndex n 22
271
- let f := fun j : Fin 15 => v j.succ.succ.succ.succ.succ.succ.succ
272
- .conj (BoundedFormula.orderedPairFormula (old z) (v 3) (v 2))
273
- (.conj (BoundedFormula.orderedPairFormula (v 3) (v 0) (v 1))
274
- (.conj (BoundedFormula.nonemptyTupleFormula 14 (v 4) f)
275
- (.conj (BoundedFormula.pairMembershipFormula (v 0) (v 4) (old packed))
276
- (.conj (.equal (f 6) (old T)) (.equal (f 10) (old nodes))))))
277
-
278
- variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
279
- variable (unions : Realize M.sets SetFormula.union Fin.elim0)
280
- variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
281
-
282
- private noncomputable def varyingBody {n}
283
- (z packed Q upperOrder nodes T levels omega C E : Fin n) : SetFormula (n + 22) :=
284
- let old := suffixIndex n 22
285
- let v := prefixIndex n 22
286
- let f := fun j : Fin 15 => v j.succ.succ.succ.succ.succ.succ.succ
287
- .conj (varyingShape z packed nodes T).toFormula
288
- (.conj (BoundedFormula.meetOrderFormula (f 10) (f 11) (v 5)).toFormula
289
- (.conj (rowAssignmentCutGraphFormula (v 6) (old Q) (f 7) (old levels) (v 0))
290
- (M.storedPreparationFormula pairing unions powers separation
291
- (v 1) (v 2) (old upperOrder) (v 6) (v 5) (old omega) (old C) (old E) f)))
292
-
293
- noncomputable def varyingPreparationFormula {n}
294
- (z packed Q upperOrder nodes T levels omega C E : Fin n) : SetFormula n :=
295
- exBlock 22 (varyingBody M pairing unions powers separation z packed Q upperOrder nodes T levels omega C E)
296
-
297
- theorem realize_varyingPreparationFormula {n}
298
- (z packed Q upperOrder nodes T levels omega C E : Fin n)
299
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
300
- Realize M.sets (M.varyingPreparationFormula pairing unions powers separation
301
- z packed Q upperOrder nodes T levels omega C E) env ↔
302
- M.VaryingPreparationCode (env packed) (env Q) (env upperOrder) (env nodes) (env T)
303
- (env levels) (env omega) (env C) (env E) (env z) := by
304
- unfold varyingPreparationFormula
305
- rw [realize_exBlock]
306
- let fs := fun w : Fin 22 → ZFSet.{u} => fun j : Fin 15 =>
307
- w j.succ.succ.succ.succ.succ.succ.succ
308
- have actual (w : Fin 22 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) :
309
- Realize M.sets (varyingBody M pairing unions powers separation
310
- z packed Q upperOrder nodes T levels omega C E) (extendMany 22 w env) ↔
311
- (env z = ZFSet.pair (w 3) (w 2) ∧ w 3 = ZFSet.pair (w 0) (w 1) ∧
312
- w 4 = refinementFormulaDataCode (fs w) ∧ ZFSet.pair (w 0) (w 4) ∈ env packed ∧
313
- fs w 6 = env T ∧ fs w 10 = env nodes) ∧
314
- MeetOrderCode (fs w 10) (fs w 11) (w 5) ∧
315
- w 6 = rowAssignmentCutGraph (env Q) (fs w 7) (env levels) (w 0) ∧
316
- M.StoredPreparationCode (env upperOrder) (w 6) (w 5) (env omega)
317
- (env C) (env E) (fs w) (w 1) (w 2) := by
318
- have allGround := extendMany_members 22 w env ground members
319
- dsimp only [varyingBody]
320
- rw [Realize, Realize, Realize,
321
- BoundedFormula.realize_toFormula M _ _ allGround,
322
- BoundedFormula.realize_toFormula M _ _ allGround,
323
- BoundedFormula.truth_meetOrderFormula,
324
- M.realize_rowAssignmentCutGraphFormula pairing unions powers separation _ _ _ _ _ _ allGround]
325
- simp only [varyingShape, BoundedFormula.Truth, BoundedFormula.truth_orderedPairFormula,
326
- BoundedFormula.truth_nonemptyTupleFormula, BoundedFormula.truth_pairMembershipFormula,
327
- extendMany_prefix, extendMany_suffix]
328
- apply and_congr_right
329
- intro _shape
330
- apply and_congr_right
331
- intro meet
332
- apply and_congr_right
333
- intro _cut
334
- simpa only [extendMany_prefix, extendMany_suffix] using
335
- (M.realize_storedPreparationFormula pairing unions powers separation
336
- (prefixIndex n 22 1) (prefixIndex n 22 2) (suffixIndex n 22 upperOrder)
337
- (prefixIndex n 22 6) (prefixIndex n 22 5) (suffixIndex n 22 omega)
338
- (suffixIndex n 22 C) (suffixIndex n 22 E)
339
- (fun j : Fin 15 => prefixIndex n 22 j.succ.succ.succ.succ.succ.succ.succ)
340
- (extendMany 22 w env) allGround (by simpa only [extendMany_prefix] using meet))
341
- constructor
342
- · rintro ⟨w, ground, body⟩
343
- obtain ⟨⟨outer, input, tuple, stored, terms, nodesEq⟩, meet, cut, prepared⟩ :=
344
- (actual w ground).1 body
345
- have canonical := meet.eq_canonicalMeetGraph
346
- refine ⟨w 0, w 1, w 2, fs w, input ▸ outer, tuple ▸ stored, terms, nodesEq,
347
- canonical ▸ meet, ?_⟩
348
- rw [canonical, cut] at prepared
349
- exact prepared
350
- · rintro ⟨alpha, p, y, fields, outer, stored, terms, nodesEq, meet, prepared⟩
351
- have hInput := M.pair_left (outer ▸ members z)
352
- have hAlpha := M.pair_left hInput
353
- have hp := M.pair_right hInput
354
- have hy := M.pair_right (outer ▸ members z)
355
- have hRecord := M.pair_right (M.transitive (members packed) stored)
356
- have hFields := M.refinementFormulaDataCode_fields_mem fields hRecord
357
- let mu := canonicalMeetGraph (fields 10) (fields 11)
358
- let cut := rowAssignmentCutGraph (env Q) (fields 7) (env levels) alpha
359
- have hMu := M.canonicalMeetGraph_mem pairing unions powers separation (hFields 10) (hFields 11)
360
- have hCut := M.rowAssignmentCutGraph_mem pairing unions powers separation
361
- (members Q) (hFields 7) (members levels) hAlpha
362
- let w : Fin 22 → ZFSet.{u} := extend alpha (extend p (extend y
363
- (extend (ZFSet.pair alpha p) (extend (refinementFormulaDataCode fields)
364
- (extend mu (extend cut fields))))))
365
- have ground : ∀ j, w j ∈ M.sets := Fin.cases hAlpha (Fin.cases hp (Fin.cases hy
366
- (Fin.cases hInput (Fin.cases hRecord (Fin.cases hMu (Fin.cases hCut hFields))))))
367
- exact ⟨w, ground, (actual w ground).2
368
- ⟨⟨outer, rfl, rfl, stored, terms, nodesEq⟩, meet, rfl, prepared⟩⟩
369
-
370
- end PartitionPilot.Forcing.TransitiveGround
371
-
372
-
373
-
374
-
375
- namespace PartitionPilot.Forcing.TransitiveGround
376
- open SetFormula
377
- universe u
378
- variable (M : TransitiveGround.{u})
379
-
380
- noncomputable def varyingPreparationRelation
381
- (stages packed Q upperOrder nodes T : ZFSet.{u}) : ZFSet.{u} :=
382
- let W := M.groundRelations T Q
383
- let C := M.supportedEqualityCertificateBound nodes W
384
- let E := M.synchronizedEnumerationBound nodes W
385
- let levels := refinementDataHistoryLevels stages packed T
386
- ZFSet.sep (M.VaryingPreparationCode packed Q upperOrder nodes T levels ZFSet.omega C E)
387
- (ZFSet.prod (ZFSet.prod stages Q) (M.preparationWitnessBound nodes T Q))
388
-
389
- theorem pair_mem_varyingPreparationRelation
390
- (stages packed Q upperOrder nodes T alpha p y : ZFSet.{u}) :
391
- ZFSet.pair (ZFSet.pair alpha p) y ∈
392
- M.varyingPreparationRelation stages packed Q upperOrder nodes T ↔
393
- alpha ∈ stages ∧ p ∈ Q ∧ y ∈ M.preparationWitnessBound nodes T Q ∧
394
- ∃ fields : Fin 15 → ZFSet.{u},
395
- ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧
396
- fields 6 = T ∧ fields 10 = nodes ∧
397
- MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧
398
- M.StoredPreparationCode upperOrder
399
- (rowAssignmentCutGraph Q (fields 7) (refinementDataHistoryLevels stages packed T) alpha)
400
- (canonicalMeetGraph (fields 10) (fields 11)) ZFSet.omega
401
- (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q))
402
- (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) fields p y := by
403
- simp only [varyingPreparationRelation, ZFSet.mem_sep, ZFSet.pair_mem_prod,
404
- M.varyingPreparationCode_pair_iff, and_assoc]
405
-
406
- include M in
407
- theorem varyingPreparationRelation_mem
408
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
409
- (unions : Realize M.sets SetFormula.union Fin.elim0)
410
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
411
- {stages packed Q upperOrder nodes T : ZFSet.{u}}
412
- (hStages : stages ∈ M.sets) (hPacked : packed ∈ M.sets)
413
- (hQ : Q ∈ M.sets) (hOrder : upperOrder ∈ M.sets)
414
- (hNodes : nodes ∈ M.sets) (hT : T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) :
415
- M.varyingPreparationRelation stages packed Q upperOrder nodes T ∈ M.sets := by
416
- let W := M.groundRelations T Q
417
- let C := M.supportedEqualityCertificateBound nodes W
418
- let E := M.synchronizedEnumerationBound nodes W
419
- let levels := refinementDataHistoryLevels stages packed T
420
- have hW := M.groundRelations_mem pairing unions powers separation hT hQ
421
- have hC := M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hW omega
422
- have hE := M.synchronizedEnumerationBound_mem pairing unions powers separation hNodes hW omega
423
- have hLevels := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hPacked hT
424
- let params : Fin 9 → ZFSet.{u} := ![packed, Q, upperOrder, nodes, T, levels, ZFSet.omega, C, E]
425
- have ground : ∀ j, params j ∈ M.sets := Fin.cases hPacked (Fin.cases hQ
426
- (Fin.cases hOrder (Fin.cases hNodes (Fin.cases hT (Fin.cases hLevels
427
- (Fin.cases omega (Fin.cases hC (Fin.cases hE (fun j => Fin.elim0 j)))))))))
428
- let formula : SetFormula 10 :=
429
- M.varyingPreparationFormula pairing unions powers separation 0 1 2 3 4 5 6 7 8 9
430
- have bound := M.prod_mem pairing unions powers separation
431
- (M.prod_mem pairing unions powers separation hStages hQ)
432
- (M.preparationWitnessBound_mem pairing unions powers separation hNodes hT hQ omega)
433
- have selected := M.separation_mem separation formula params ground bound
434
- have equal : ZFSet.sep (fun z => Realize M.sets formula (extend z params))
435
- (ZFSet.prod (ZFSet.prod stages Q) (M.preparationWitnessBound nodes T Q)) =
436
- M.varyingPreparationRelation stages packed Q upperOrder nodes T := by
437
- apply ZFSet.ext
438
- intro z
439
- rw [ZFSet.mem_sep, varyingPreparationRelation, ZFSet.mem_sep]
440
- apply and_congr_right
441
- intro hz
442
- exact M.realize_varyingPreparationFormula pairing unions powers separation
443
- 0 1 2 3 4 5 6 7 8 9 (extend z params) (Fin.cases (M.transitive bound hz) ground)
444
- exact equal ▸ selected
445
-
446
- end PartitionPilot.Forcing.TransitiveGround
447
-
448
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Forcing.GroundNicePreparationWitnessBounds
2
+ import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralHistoryTestUnions
3
+
4
+ namespace OAI
5
+
6
+
7
+
8
+ namespace PartitionPilot.Forcing.TransitiveGround
9
+ open SetFormula
10
+ universe u
11
+ variable (M : TransitiveGround.{u})
12
+
13
+ def StoredPreparationCode (upperOrder cutGraph meet omega C E : ZFSet.{u})
14
+ (fields : Fin 15 → ZFSet.{u}) (p y : ZFSet.{u}) : Prop :=
15
+ ∃ row A r k enumerations q,
16
+ p = ZFSet.pair row A ∧ y = ZFSet.pair r (ZFSet.pair k enumerations) ∧
17
+ ZFSet.pair r p ∈ upperOrder ∧ ZFSet.pair r q ∈ cutGraph ∧
18
+ PreparedCertificateFamilyCode M (fields 7) (fields 8) q (fields 10) (fields 11)
19
+ meet (fields 14) (fields 13) (fields 9) omega (M.storedPreparationRequests A fields)
20
+ C E k enumerations
21
+
22
+ private def transitionShape {n} (p y upperOrder cutGraph : Fin n) : BoundedFormula (n + 8) :=
23
+ let old := suffixIndex n 8
24
+ let v := prefixIndex n 8
25
+ .conj (BoundedFormula.orderedPairFormula (old p) (v 0) (v 1))
26
+ (.conj (BoundedFormula.orderedPairFormula (old y) (v 2) (v 5))
27
+ (.conj (BoundedFormula.orderedPairFormula (v 5) (v 3) (v 4))
28
+ (.conj (BoundedFormula.pairMembershipFormula (v 2) (old p) (old upperOrder))
29
+ (BoundedFormula.pairMembershipFormula (v 2) (v 6) (old cutGraph)))))
30
+
31
+ variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
32
+ variable (unions : Realize M.sets SetFormula.union Fin.elim0)
33
+ variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
34
+
35
+ private noncomputable def transitionBody {n}
36
+ (p y upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n) : SetFormula (n + 8) :=
37
+ let old := suffixIndex n 8
38
+ let v := prefixIndex n 8
39
+ .conj (transitionShape p y upperOrder cutGraph).toFormula
40
+ (.conj (SetFormula.reindex (extend (v 7) (extend (v 1) (fun j => old (fields j))))
41
+ (M.definable_storedPreparationRequests pairing unions powers separation).formula)
42
+ (preparedCertificateFamilyFormula (old (fields 7)) (old (fields 8)) (v 6)
43
+ (old (fields 10)) (old (fields 11)) (old meet) (old (fields 14))
44
+ (old (fields 13)) (old (fields 9)) (old omega) (v 7) (old C) (old E) (v 3) (v 4)))
45
+
46
+ noncomputable def storedPreparationFormula {n}
47
+ (p y upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n) : SetFormula n :=
48
+ exBlock 8 (transitionBody M pairing unions powers separation p y upperOrder cutGraph meet omega C E fields)
49
+
50
+ theorem realize_storedPreparationFormula {n}
51
+ (p y upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n)
52
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
53
+ (meetCode : MeetOrderCode (env (fields 10)) (env (fields 11)) (env meet)) :
54
+ Realize M.sets (M.storedPreparationFormula pairing unions powers separation
55
+ p y upperOrder cutGraph meet omega C E fields) env ↔
56
+ M.StoredPreparationCode (env upperOrder) (env cutGraph) (env meet) (env omega)
57
+ (env C) (env E) (fun j => env (fields j)) (env p) (env y) := by
58
+ unfold storedPreparationFormula
59
+ rw [realize_exBlock]
60
+ have actual (w : Fin 8 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) :
61
+ Realize M.sets (transitionBody M pairing unions powers separation
62
+ p y upperOrder cutGraph meet omega C E fields) (extendMany 8 w env) ↔
63
+ (env p = ZFSet.pair (w 0) (w 1) ∧ env y = ZFSet.pair (w 2) (w 5) ∧
64
+ w 5 = ZFSet.pair (w 3) (w 4) ∧ ZFSet.pair (w 2) (env p) ∈ env upperOrder ∧
65
+ ZFSet.pair (w 2) (w 6) ∈ env cutGraph) ∧
66
+ w 7 = M.storedPreparationRequests (w 1) (fun j => env (fields j)) ∧
67
+ PreparedCertificateFamilyCode M (env (fields 7)) (env (fields 8)) (w 6)
68
+ (env (fields 10)) (env (fields 11)) (env meet) (env (fields 14))
69
+ (env (fields 13)) (env (fields 9)) (env omega) (w 7) (env C) (env E) (w 3) (w 4) := by
70
+ have allGround := extendMany_members 8 w env ground members
71
+ dsimp only [transitionBody]
72
+ rw [Realize, Realize, BoundedFormula.realize_toFormula M _ _ allGround]
73
+ have request : Realize M.sets (SetFormula.reindex
74
+ (extend (prefixIndex n 8 7) (extend (prefixIndex n 8 1)
75
+ (fun j => suffixIndex n 8 (fields j))))
76
+ (M.definable_storedPreparationRequests pairing unions powers separation).formula)
77
+ (extendMany 8 w env) ↔
78
+ w 7 = M.storedPreparationRequests (w 1) (fun j => env (fields j)) := by
79
+ rw [realize_reindex, map_extend, map_extend]
80
+ simp only [extendMany_prefix, extendMany_suffix]
81
+ exact (M.definable_storedPreparationRequests pairing unions powers separation).correct
82
+ (extend (w 1) (fun j => env (fields j)))
83
+ (Fin.cases (ground 1) (fun j => members (fields j))) (w 7) (ground 7)
84
+ rw [request, M.realize_preparedCertificateFamilyFormula _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
85
+ _ allGround (by simpa only [extendMany_suffix] using meetCode)]
86
+ simp only [transitionShape, BoundedFormula.Truth, BoundedFormula.truth_orderedPairFormula,
87
+ BoundedFormula.truth_pairMembershipFormula, extendMany_prefix, extendMany_suffix]
88
+ constructor
89
+ · rintro ⟨w, ground, body⟩
90
+ obtain ⟨⟨input, output, tail, below, cut⟩, requests, prepared⟩ := (actual w ground).1 body
91
+ exact ⟨w 0, w 1, w 2, w 3, w 4, w 6, input, tail ▸ output, below, cut, requests ▸ prepared⟩
92
+ · rintro ⟨row, A, r, k, enumerations, q, input, output, below, cut, prepared⟩
93
+ have hp := input ▸ members p
94
+ have hy := output ▸ members y
95
+ have hTail := M.pair_right hy
96
+ have hq := M.pair_right (M.transitive (members cutGraph) cut)
97
+ let J := M.storedPreparationRequests A (fun j => env (fields j))
98
+ have hJ := M.storedPreparationRequests_mem pairing unions powers separation (M.pair_right hp)
99
+ (fun j => env (fields j)) (fun j => members (fields j))
100
+ let w : Fin 8 → ZFSet.{u} := ![row, A, r, k, enumerations, ZFSet.pair k enumerations, q, J]
101
+ have ground : ∀ j, w j ∈ M.sets := Fin.cases (M.pair_left hp)
102
+ (Fin.cases (M.pair_right hp) (Fin.cases (M.pair_left hy)
103
+ (Fin.cases (M.pair_left hTail) (Fin.cases (M.pair_right hTail)
104
+ (Fin.cases hTail (Fin.cases hq (Fin.cases hJ (fun j => Fin.elim0 j))))))))
105
+ exact ⟨w, ground, (actual w ground).2 ⟨⟨input, output, rfl, below, cut⟩, rfl, prepared⟩⟩
106
+
107
+ end PartitionPilot.Forcing.TransitiveGround
108
+
109
+
110
+
111
+
112
+ namespace PartitionPilot.Forcing.TransitiveGround
113
+ open SetFormula
114
+ universe u
115
+ variable (M : TransitiveGround.{u})
116
+
117
+ noncomputable def storedPreparationRelation
118
+ (Q upperOrder nodes T levels alpha meet : ZFSet.{u}) (fields : Fin 15 → ZFSet.{u}) : ZFSet.{u} :=
119
+ let W := M.groundRelations T Q
120
+ let C := M.supportedEqualityCertificateBound nodes W
121
+ let E := M.synchronizedEnumerationBound nodes W
122
+ let cut := rowAssignmentCutGraph Q (fields 7) levels alpha
123
+ ZFSet.sep (fun z => ∃ p y, z = ZFSet.pair p y ∧
124
+ M.StoredPreparationCode upperOrder cut meet ZFSet.omega C E fields p y)
125
+ (ZFSet.prod Q (M.preparationWitnessBound nodes T Q))
126
+
127
+ theorem pair_mem_storedPreparationRelation
128
+ (Q upperOrder nodes T levels alpha meet : ZFSet.{u}) (fields : Fin 15 → ZFSet.{u})
129
+ (p y : ZFSet.{u}) :
130
+ ZFSet.pair p y ∈ M.storedPreparationRelation Q upperOrder nodes T levels alpha meet fields ↔
131
+ p ∈ Q ∧ y ∈ M.preparationWitnessBound nodes T Q ∧
132
+ M.StoredPreparationCode upperOrder (rowAssignmentCutGraph Q (fields 7) levels alpha)
133
+ meet ZFSet.omega (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q))
134
+ (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) fields p y := by
135
+ rw [storedPreparationRelation, ZFSet.mem_sep, ZFSet.pair_mem_prod]
136
+ constructor
137
+ · rintro ⟨⟨hp, hy⟩, p', y', eq, code⟩
138
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq
139
+ exact ⟨hp, hy, code⟩
140
+ · rintro ⟨hp, hy, code⟩
141
+ exact ⟨⟨hp, hy⟩, p, y, rfl, code⟩
142
+
143
+ variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
144
+ variable (unions : Realize M.sets SetFormula.union Fin.elim0)
145
+ variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
146
+
147
+ private noncomputable def preparationEntryFormula {n}
148
+ (z upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n) : SetFormula n :=
149
+ let old := suffixIndex n 2
150
+ let v := prefixIndex n 2
151
+ exBlock 2 (.conj (BoundedFormula.orderedPairFormula (old z) (v 0) (v 1)).toFormula
152
+ (M.storedPreparationFormula pairing unions powers separation
153
+ (v 0) (v 1) (old upperOrder) (old cutGraph) (old meet) (old omega) (old C) (old E)
154
+ (fun j => old (fields j))))
155
+
156
+ private theorem realize_preparationEntryFormula {n}
157
+ (z upperOrder cutGraph meet omega C E : Fin n) (fields : Fin 15 → Fin n)
158
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
159
+ (meetCode : MeetOrderCode (env (fields 10)) (env (fields 11)) (env meet)) :
160
+ Realize M.sets (preparationEntryFormula M pairing unions powers separation
161
+ z upperOrder cutGraph meet omega C E fields) env ↔
162
+ ∃ p y, env z = ZFSet.pair p y ∧
163
+ M.StoredPreparationCode (env upperOrder) (env cutGraph) (env meet) (env omega)
164
+ (env C) (env E) (fun j => env (fields j)) p y := by
165
+ unfold preparationEntryFormula
166
+ rw [realize_exBlock]
167
+ have actual (w : Fin 2 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) :
168
+ Realize M.sets (.conj
169
+ (BoundedFormula.orderedPairFormula (suffixIndex n 2 z)
170
+ (prefixIndex n 2 0) (prefixIndex n 2 1)).toFormula
171
+ (M.storedPreparationFormula pairing unions powers separation
172
+ (prefixIndex n 2 0) (prefixIndex n 2 1) (suffixIndex n 2 upperOrder)
173
+ (suffixIndex n 2 cutGraph) (suffixIndex n 2 meet) (suffixIndex n 2 omega)
174
+ (suffixIndex n 2 C) (suffixIndex n 2 E) (fun j => suffixIndex n 2 (fields j))))
175
+ (extendMany 2 w env) ↔
176
+ env z = ZFSet.pair (w 0) (w 1) ∧
177
+ M.StoredPreparationCode (env upperOrder) (env cutGraph) (env meet) (env omega)
178
+ (env C) (env E) (fun j => env (fields j)) (w 0) (w 1) := by
179
+ have allGround := extendMany_members 2 w env ground members
180
+ rw [Realize, BoundedFormula.realize_toFormula M _ _ allGround,
181
+ BoundedFormula.truth_orderedPairFormula,
182
+ M.realize_storedPreparationFormula pairing unions powers separation
183
+ _ _ _ _ _ _ _ _ _ _ allGround (by simpa only [extendMany_suffix] using meetCode)]
184
+ simp only [extendMany_prefix, extendMany_suffix]
185
+ constructor
186
+ · rintro ⟨w, ground, body⟩
187
+ exact ⟨w 0, w 1, (actual w ground).1 body⟩
188
+ · rintro ⟨p, y, equal, code⟩
189
+ have hp := M.pair_left (equal ▸ members z)
190
+ have hy := M.pair_right (equal ▸ members z)
191
+ exact ⟨![p, y], Fin.cases hp (Fin.cases hy (fun j => Fin.elim0 j)),
192
+ (actual ![p, y] (Fin.cases hp (Fin.cases hy (fun j => Fin.elim0 j)))).2 ⟨equal, code⟩⟩
193
+
194
+ include pairing unions powers separation in
195
+ theorem storedPreparationRelation_mem
196
+ {Q upperOrder nodes T levels alpha meet : ZFSet.{u}}
197
+ (hQ : Q ∈ M.sets) (hOrder : upperOrder ∈ M.sets) (hNodes : nodes ∈ M.sets)
198
+ (hT : T ∈ M.sets) (hLevels : levels ∈ M.sets) (hAlpha : alpha ∈ M.sets)
199
+ (hMeet : meet ∈ M.sets) (omega : ZFSet.omega ∈ M.sets)
200
+ (fields : Fin 15 → ZFSet.{u}) (members : ∀ j, fields j ∈ M.sets)
201
+ (meetCode : MeetOrderCode (fields 10) (fields 11) meet) :
202
+ M.storedPreparationRelation Q upperOrder nodes T levels alpha meet fields ∈ M.sets := by
203
+ let W := M.groundRelations T Q
204
+ let C := M.supportedEqualityCertificateBound nodes W
205
+ let E := M.synchronizedEnumerationBound nodes W
206
+ let cut := rowAssignmentCutGraph Q (fields 7) levels alpha
207
+ have hW := M.groundRelations_mem pairing unions powers separation hT hQ
208
+ have hC := M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hW omega
209
+ have hE := M.synchronizedEnumerationBound_mem pairing unions powers separation hNodes hW omega
210
+ have hCut := M.rowAssignmentCutGraph_mem pairing unions powers separation hQ (members 7) hLevels hAlpha
211
+ let params : Fin 21 → ZFSet.{u} :=
212
+ extend upperOrder (extend cut (extend meet (extend ZFSet.omega (extend C (extend E fields)))))
213
+ have ground : ∀ j, params j ∈ M.sets := Fin.cases hOrder (Fin.cases hCut
214
+ (Fin.cases hMeet (Fin.cases omega (Fin.cases hC (Fin.cases hE members)))))
215
+ let slots : Fin 15 → Fin 22 := fun j => j.succ.succ.succ.succ.succ.succ.succ
216
+ let formula := preparationEntryFormula M pairing unions powers separation 0 1 2 3 4 5 6 slots
217
+ have bound := M.prod_mem pairing unions powers separation hQ
218
+ (M.preparationWitnessBound_mem pairing unions powers separation hNodes hT hQ omega)
219
+ have selected := M.separation_mem separation formula params ground bound
220
+ have equal : ZFSet.sep (fun z => Realize M.sets formula (extend z params))
221
+ (ZFSet.prod Q (M.preparationWitnessBound nodes T Q)) =
222
+ M.storedPreparationRelation Q upperOrder nodes T levels alpha meet fields := by
223
+ apply ZFSet.ext
224
+ intro z
225
+ rw [ZFSet.mem_sep, storedPreparationRelation, ZFSet.mem_sep]
226
+ apply and_congr_right
227
+ intro hz
228
+ exact realize_preparationEntryFormula M pairing unions powers separation 0 1 2 3 4 5 6 slots
229
+ (extend z params) (Fin.cases (M.transitive bound hz) ground) meetCode
230
+ exact equal ▸ selected
231
+
232
+ end PartitionPilot.Forcing.TransitiveGround
233
+
234
+
235
+
236
+
237
+ namespace PartitionPilot.Forcing.TransitiveGround
238
+ open SetFormula
239
+ universe u
240
+ variable (M : TransitiveGround.{u})
241
+
242
+ def VaryingPreparationCode (packed Q upperOrder nodes T levels omega C E z : ZFSet.{u}) : Prop :=
243
+ ∃ alpha p y, ∃ fields : Fin 15 → ZFSet.{u},
244
+ z = ZFSet.pair (ZFSet.pair alpha p) y ∧
245
+ ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧
246
+ fields 6 = T ∧ fields 10 = nodes ∧
247
+ MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧
248
+ M.StoredPreparationCode upperOrder (rowAssignmentCutGraph Q (fields 7) levels alpha)
249
+ (canonicalMeetGraph (fields 10) (fields 11)) omega C E fields p y
250
+
251
+ theorem varyingPreparationCode_pair_iff (packed Q upperOrder nodes T levels omega C E alpha p y : ZFSet.{u}) :
252
+ M.VaryingPreparationCode packed Q upperOrder nodes T levels omega C E
253
+ (ZFSet.pair (ZFSet.pair alpha p) y) ↔
254
+ ∃ fields : Fin 15 → ZFSet.{u},
255
+ ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧
256
+ fields 6 = T ∧ fields 10 = nodes ∧
257
+ MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧
258
+ M.StoredPreparationCode upperOrder (rowAssignmentCutGraph Q (fields 7) levels alpha)
259
+ (canonicalMeetGraph (fields 10) (fields 11)) omega C E fields p y := by
260
+ constructor
261
+ · rintro ⟨alpha', p', y', fields, equal, rest⟩
262
+ obtain ⟨input, rfl⟩ := ZFSet.pair_inj.1 equal
263
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 input
264
+ exact ⟨fields, rest⟩
265
+ · rintro ⟨fields, rest⟩
266
+ exact ⟨alpha, p, y, fields, rfl, rest⟩
267
+
268
+ private def varyingShape {n} (z packed nodes T : Fin n) : BoundedFormula (n + 22) :=
269
+ let old := suffixIndex n 22
270
+ let v := prefixIndex n 22
271
+ let f := fun j : Fin 15 => v j.succ.succ.succ.succ.succ.succ.succ
272
+ .conj (BoundedFormula.orderedPairFormula (old z) (v 3) (v 2))
273
+ (.conj (BoundedFormula.orderedPairFormula (v 3) (v 0) (v 1))
274
+ (.conj (BoundedFormula.nonemptyTupleFormula 14 (v 4) f)
275
+ (.conj (BoundedFormula.pairMembershipFormula (v 0) (v 4) (old packed))
276
+ (.conj (.equal (f 6) (old T)) (.equal (f 10) (old nodes))))))
277
+
278
+ variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
279
+ variable (unions : Realize M.sets SetFormula.union Fin.elim0)
280
+ variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
281
+
282
+ private noncomputable def varyingBody {n}
283
+ (z packed Q upperOrder nodes T levels omega C E : Fin n) : SetFormula (n + 22) :=
284
+ let old := suffixIndex n 22
285
+ let v := prefixIndex n 22
286
+ let f := fun j : Fin 15 => v j.succ.succ.succ.succ.succ.succ.succ
287
+ .conj (varyingShape z packed nodes T).toFormula
288
+ (.conj (BoundedFormula.meetOrderFormula (f 10) (f 11) (v 5)).toFormula
289
+ (.conj (rowAssignmentCutGraphFormula (v 6) (old Q) (f 7) (old levels) (v 0))
290
+ (M.storedPreparationFormula pairing unions powers separation
291
+ (v 1) (v 2) (old upperOrder) (v 6) (v 5) (old omega) (old C) (old E) f)))
292
+
293
+ noncomputable def varyingPreparationFormula {n}
294
+ (z packed Q upperOrder nodes T levels omega C E : Fin n) : SetFormula n :=
295
+ exBlock 22 (varyingBody M pairing unions powers separation z packed Q upperOrder nodes T levels omega C E)
296
+
297
+ theorem realize_varyingPreparationFormula {n}
298
+ (z packed Q upperOrder nodes T levels omega C E : Fin n)
299
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
300
+ Realize M.sets (M.varyingPreparationFormula pairing unions powers separation
301
+ z packed Q upperOrder nodes T levels omega C E) env ↔
302
+ M.VaryingPreparationCode (env packed) (env Q) (env upperOrder) (env nodes) (env T)
303
+ (env levels) (env omega) (env C) (env E) (env z) := by
304
+ unfold varyingPreparationFormula
305
+ rw [realize_exBlock]
306
+ let fs := fun w : Fin 22 → ZFSet.{u} => fun j : Fin 15 =>
307
+ w j.succ.succ.succ.succ.succ.succ.succ
308
+ have actual (w : Fin 22 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) :
309
+ Realize M.sets (varyingBody M pairing unions powers separation
310
+ z packed Q upperOrder nodes T levels omega C E) (extendMany 22 w env) ↔
311
+ (env z = ZFSet.pair (w 3) (w 2) ∧ w 3 = ZFSet.pair (w 0) (w 1) ∧
312
+ w 4 = refinementFormulaDataCode (fs w) ∧ ZFSet.pair (w 0) (w 4) ∈ env packed ∧
313
+ fs w 6 = env T ∧ fs w 10 = env nodes) ∧
314
+ MeetOrderCode (fs w 10) (fs w 11) (w 5) ∧
315
+ w 6 = rowAssignmentCutGraph (env Q) (fs w 7) (env levels) (w 0) ∧
316
+ M.StoredPreparationCode (env upperOrder) (w 6) (w 5) (env omega)
317
+ (env C) (env E) (fs w) (w 1) (w 2) := by
318
+ have allGround := extendMany_members 22 w env ground members
319
+ dsimp only [varyingBody]
320
+ rw [Realize, Realize, Realize,
321
+ BoundedFormula.realize_toFormula M _ _ allGround,
322
+ BoundedFormula.realize_toFormula M _ _ allGround,
323
+ BoundedFormula.truth_meetOrderFormula,
324
+ M.realize_rowAssignmentCutGraphFormula pairing unions powers separation _ _ _ _ _ _ allGround]
325
+ simp only [varyingShape, BoundedFormula.Truth, BoundedFormula.truth_orderedPairFormula,
326
+ BoundedFormula.truth_nonemptyTupleFormula, BoundedFormula.truth_pairMembershipFormula,
327
+ extendMany_prefix, extendMany_suffix]
328
+ apply and_congr_right
329
+ intro _shape
330
+ apply and_congr_right
331
+ intro meet
332
+ apply and_congr_right
333
+ intro _cut
334
+ simpa only [extendMany_prefix, extendMany_suffix] using
335
+ (M.realize_storedPreparationFormula pairing unions powers separation
336
+ (prefixIndex n 22 1) (prefixIndex n 22 2) (suffixIndex n 22 upperOrder)
337
+ (prefixIndex n 22 6) (prefixIndex n 22 5) (suffixIndex n 22 omega)
338
+ (suffixIndex n 22 C) (suffixIndex n 22 E)
339
+ (fun j : Fin 15 => prefixIndex n 22 j.succ.succ.succ.succ.succ.succ.succ)
340
+ (extendMany 22 w env) allGround (by simpa only [extendMany_prefix] using meet))
341
+ constructor
342
+ · rintro ⟨w, ground, body⟩
343
+ obtain ⟨⟨outer, input, tuple, stored, terms, nodesEq⟩, meet, cut, prepared⟩ :=
344
+ (actual w ground).1 body
345
+ have canonical := meet.eq_canonicalMeetGraph
346
+ refine ⟨w 0, w 1, w 2, fs w, input ▸ outer, tuple ▸ stored, terms, nodesEq,
347
+ canonical ▸ meet, ?_⟩
348
+ rw [canonical, cut] at prepared
349
+ exact prepared
350
+ · rintro ⟨alpha, p, y, fields, outer, stored, terms, nodesEq, meet, prepared⟩
351
+ have hInput := M.pair_left (outer ▸ members z)
352
+ have hAlpha := M.pair_left hInput
353
+ have hp := M.pair_right hInput
354
+ have hy := M.pair_right (outer ▸ members z)
355
+ have hRecord := M.pair_right (M.transitive (members packed) stored)
356
+ have hFields := M.refinementFormulaDataCode_fields_mem fields hRecord
357
+ let mu := canonicalMeetGraph (fields 10) (fields 11)
358
+ let cut := rowAssignmentCutGraph (env Q) (fields 7) (env levels) alpha
359
+ have hMu := M.canonicalMeetGraph_mem pairing unions powers separation (hFields 10) (hFields 11)
360
+ have hCut := M.rowAssignmentCutGraph_mem pairing unions powers separation
361
+ (members Q) (hFields 7) (members levels) hAlpha
362
+ let w : Fin 22 → ZFSet.{u} := extend alpha (extend p (extend y
363
+ (extend (ZFSet.pair alpha p) (extend (refinementFormulaDataCode fields)
364
+ (extend mu (extend cut fields))))))
365
+ have ground : ∀ j, w j ∈ M.sets := Fin.cases hAlpha (Fin.cases hp (Fin.cases hy
366
+ (Fin.cases hInput (Fin.cases hRecord (Fin.cases hMu (Fin.cases hCut hFields))))))
367
+ exact ⟨w, ground, (actual w ground).2
368
+ ⟨⟨outer, rfl, rfl, stored, terms, nodesEq⟩, meet, rfl, prepared⟩⟩
369
+
370
+ end PartitionPilot.Forcing.TransitiveGround
371
+
372
+
373
+
374
+
375
+ namespace PartitionPilot.Forcing.TransitiveGround
376
+ open SetFormula
377
+ universe u
378
+ variable (M : TransitiveGround.{u})
379
+
380
+ noncomputable def varyingPreparationRelation
381
+ (stages packed Q upperOrder nodes T : ZFSet.{u}) : ZFSet.{u} :=
382
+ let W := M.groundRelations T Q
383
+ let C := M.supportedEqualityCertificateBound nodes W
384
+ let E := M.synchronizedEnumerationBound nodes W
385
+ let levels := refinementDataHistoryLevels stages packed T
386
+ ZFSet.sep (M.VaryingPreparationCode packed Q upperOrder nodes T levels ZFSet.omega C E)
387
+ (ZFSet.prod (ZFSet.prod stages Q) (M.preparationWitnessBound nodes T Q))
388
+
389
+ theorem pair_mem_varyingPreparationRelation
390
+ (stages packed Q upperOrder nodes T alpha p y : ZFSet.{u}) :
391
+ ZFSet.pair (ZFSet.pair alpha p) y ∈
392
+ M.varyingPreparationRelation stages packed Q upperOrder nodes T ↔
393
+ alpha ∈ stages ∧ p ∈ Q ∧ y ∈ M.preparationWitnessBound nodes T Q ∧
394
+ ∃ fields : Fin 15 → ZFSet.{u},
395
+ ZFSet.pair alpha (refinementFormulaDataCode fields) ∈ packed ∧
396
+ fields 6 = T ∧ fields 10 = nodes ∧
397
+ MeetOrderCode (fields 10) (fields 11) (canonicalMeetGraph (fields 10) (fields 11)) ∧
398
+ M.StoredPreparationCode upperOrder
399
+ (rowAssignmentCutGraph Q (fields 7) (refinementDataHistoryLevels stages packed T) alpha)
400
+ (canonicalMeetGraph (fields 10) (fields 11)) ZFSet.omega
401
+ (M.supportedEqualityCertificateBound nodes (M.groundRelations T Q))
402
+ (M.synchronizedEnumerationBound nodes (M.groundRelations T Q)) fields p y := by
403
+ simp only [varyingPreparationRelation, ZFSet.mem_sep, ZFSet.pair_mem_prod,
404
+ M.varyingPreparationCode_pair_iff, and_assoc]
405
+
406
+ include M in
407
+ theorem varyingPreparationRelation_mem
408
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
409
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
410
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
411
+ {stages packed Q upperOrder nodes T : ZFSet.{u}}
412
+ (hStages : stages ∈ M.sets) (hPacked : packed ∈ M.sets)
413
+ (hQ : Q ∈ M.sets) (hOrder : upperOrder ∈ M.sets)
414
+ (hNodes : nodes ∈ M.sets) (hT : T ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) :
415
+ M.varyingPreparationRelation stages packed Q upperOrder nodes T ∈ M.sets := by
416
+ let W := M.groundRelations T Q
417
+ let C := M.supportedEqualityCertificateBound nodes W
418
+ let E := M.synchronizedEnumerationBound nodes W
419
+ let levels := refinementDataHistoryLevels stages packed T
420
+ have hW := M.groundRelations_mem pairing unions powers separation hT hQ
421
+ have hC := M.supportedEqualityCertificateBound_mem pairing unions powers separation hNodes hW omega
422
+ have hE := M.synchronizedEnumerationBound_mem pairing unions powers separation hNodes hW omega
423
+ have hLevels := M.refinementDataHistoryLevels_mem pairing unions powers separation hStages hPacked hT
424
+ let params : Fin 9 → ZFSet.{u} := ![packed, Q, upperOrder, nodes, T, levels, ZFSet.omega, C, E]
425
+ have ground : ∀ j, params j ∈ M.sets := Fin.cases hPacked (Fin.cases hQ
426
+ (Fin.cases hOrder (Fin.cases hNodes (Fin.cases hT (Fin.cases hLevels
427
+ (Fin.cases omega (Fin.cases hC (Fin.cases hE (fun j => Fin.elim0 j)))))))))
428
+ let formula : SetFormula 10 :=
429
+ M.varyingPreparationFormula pairing unions powers separation 0 1 2 3 4 5 6 7 8 9
430
+ have bound := M.prod_mem pairing unions powers separation
431
+ (M.prod_mem pairing unions powers separation hStages hQ)
432
+ (M.preparationWitnessBound_mem pairing unions powers separation hNodes hT hQ omega)
433
+ have selected := M.separation_mem separation formula params ground bound
434
+ have equal : ZFSet.sep (fun z => Realize M.sets formula (extend z params))
435
+ (ZFSet.prod (ZFSet.prod stages Q) (M.preparationWitnessBound nodes T Q)) =
436
+ M.varyingPreparationRelation stages packed Q upperOrder nodes T := by
437
+ apply ZFSet.ext
438
+ intro z
439
+ rw [ZFSet.mem_sep, varyingPreparationRelation, ZFSet.mem_sep]
440
+ apply and_congr_right
441
+ intro hz
442
+ exact M.realize_varyingPreparationFormula pairing unions powers separation
443
+ 0 1 2 3 4 5 6 7 8 9 (extend z params) (Fin.cases (M.transitive bound hz) ground)
444
+ exact equal ▸ selected
445
+
446
+ end PartitionPilot.Forcing.TransitiveGround
447
+
448
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/HistoryFieldFormulas.lean CHANGED
@@ -1,124 +1,124 @@
1
- import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveStateFieldEnvironments
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
-
9
- universe u
10
- namespace SetFormula
11
-
12
- def stateFieldFormula {n} (code value : Fin n) (j : Fin 13) : SetFormula n :=
13
- exBlock 13 (.conj
14
- (BoundedFormula.nonemptyTupleFormula 12 (suffixIndex n 13 code) (prefixIndex n 13)).toFormula
15
- (.equal (suffixIndex n 13 value) (prefixIndex n 13 j)))
16
-
17
- def historyFieldValueFormula {n} (index value history : Fin n) (j : Fin 13) : SetFormula n :=
18
- ex (.conj (BoundedFormula.pairMembershipFormula index.succ 0 history.succ).toFormula
19
- (stateFieldFormula 0 value.succ j))
20
-
21
- def historyFieldPairFormula {n} (index output history : Fin n) (j : Fin 13) : SetFormula n :=
22
- ex (.conj (historyFieldValueFormula index.succ 0 history.succ j)
23
- (BoundedFormula.orderedPairFormula output.succ index.succ 0).toFormula)
24
-
25
- end SetFormula
26
-
27
- namespace TransitiveGround
28
- open SetFormula
29
- variable (M : TransitiveGround.{u})
30
-
31
- theorem realize_stateFieldFormula {n} (code value : Fin n) (j : Fin 13)
32
- (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets)
33
- (state : RecursiveStateData.{u}) (coded : env code = state.code) :
34
- Realize M.sets (stateFieldFormula code value j) env ↔ env value = state.field j := by
35
- rw [stateFieldFormula, realize_exBlock]
36
- constructor
37
- · rintro ⟨fields, fieldMembers, tuple, entry⟩
38
- have equal := (BoundedFormula.truth_nonemptyTupleFormula 12 (suffixIndex n 13 code)
39
- (prefixIndex n 13) _).1
40
- ((BoundedFormula.realize_toFormula M _ _ (extendMany_members 13 fields env fieldMembers members)).1 tuple)
41
- simp only [extendMany_suffix, extendMany_prefix] at equal
42
- have fieldsEqual : fields = state.field :=
43
- nonemptyTupleCode_injective 12 (equal.symm.trans coded)
44
- change extendMany 13 fields env (suffixIndex n 13 value) =
45
- extendMany 13 fields env (prefixIndex n 13 j) at entry
46
- simpa only [extendMany_suffix, extendMany_prefix, fieldsEqual] using entry
47
- · intro equal
48
- have fieldMembers := M.recursiveStateData_field_mem state (coded ▸ members code)
49
- refine ⟨state.field, fieldMembers, ?_, ?_⟩
50
- · apply (BoundedFormula.realize_toFormula M _ _
51
- (extendMany_members 13 state.field env fieldMembers members)).2
52
- apply (BoundedFormula.truth_nonemptyTupleFormula 12 (suffixIndex n 13 code)
53
- (prefixIndex n 13) _).2
54
- simp only [extendMany_suffix, extendMany_prefix]
55
- exact coded
56
- · change extendMany 13 state.field env (suffixIndex n 13 value) =
57
- extendMany 13 state.field env (prefixIndex n 13 j)
58
- simpa only [extendMany_suffix, extendMany_prefix] using equal
59
-
60
- theorem realize_historyFieldValueFormula {k} (index value history : Fin k) (j : Fin 13)
61
- (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets)
62
- (states : Nat → RecursiveStateData.{u})
63
- (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ env history ↔ y = (states n).code)
64
- (n : Nat) (indexEq : env index = natSetCode n) :
65
- Realize M.sets (historyFieldValueFormula index value history j) env ↔
66
- env value = (states n).field j := by
67
- rw [historyFieldValueFormula, realize_ex]
68
- constructor
69
- · rintro ⟨code, hcode, entry, projected⟩
70
- have extended : ∀ i, extend code env i ∈ M.sets := Fin.cases hcode members
71
- have actual := (BoundedFormula.truth_pairMembershipFormula index.succ 0 history.succ _).1
72
- ((BoundedFormula.realize_toFormula M _ _ extended).1 entry)
73
- change ZFSet.pair (env index) code ∈ env history at actual
74
- rw [indexEq] at actual
75
- exact (M.realize_stateFieldFormula 0 value.succ j (extend code env) extended
76
- (states n) ((entries n code).1 actual)).1 projected
77
- · intro equal
78
- have entry : ZFSet.pair (natSetCode n) (states n).code ∈ env history :=
79
- (entries n _).2 rfl
80
- have hcode := M.pair_right (M.transitive (members history) entry)
81
- have extended : ∀ i, extend (states n).code env i ∈ M.sets := Fin.cases hcode members
82
- refine ⟨(states n).code, hcode, ?_, ?_⟩
83
- · apply (BoundedFormula.realize_toFormula M _ _ extended).2
84
- apply (BoundedFormula.truth_pairMembershipFormula index.succ 0 history.succ _).2
85
- change ZFSet.pair (env index) (states n).code ∈ env history
86
- exact indexEq.symm ▸ entry
87
- · exact (M.realize_stateFieldFormula 0 value.succ j _ extended (states n) rfl).2 equal
88
-
89
- theorem realize_historyFieldPairFormula {k} (index output history : Fin k) (j : Fin 13)
90
- (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets)
91
- (states : Nat → RecursiveStateData.{u})
92
- (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ env history ↔ y = (states n).code)
93
- (n : Nat) (indexEq : env index = natSetCode n) :
94
- Realize M.sets (historyFieldPairFormula index output history j) env ↔
95
- env output = ZFSet.pair (natSetCode n) ((states n).field j) := by
96
- rw [historyFieldPairFormula, realize_ex]
97
- constructor
98
- · rintro ⟨value, hvalue, specified, pair⟩
99
- have extended : ∀ i, extend value env i ∈ M.sets := Fin.cases hvalue members
100
- have valueEq := (M.realize_historyFieldValueFormula index.succ 0 history.succ j
101
- (extend value env) extended states entries n indexEq).1 specified
102
- have pairEq := (BoundedFormula.truth_orderedPairFormula output.succ index.succ 0 _).1
103
- ((BoundedFormula.realize_toFormula M _ _ extended).1 pair)
104
- change env output = ZFSet.pair (env index) value at pairEq
105
- exact pairEq.trans (congrArg₂ ZFSet.pair indexEq valueEq)
106
- · intro equal
107
- have codeM := M.pair_right (M.transitive (members history) ((entries n _).2 rfl))
108
- have valueM := M.recursiveStateData_field_mem (states n) codeM j
109
- have extended : ∀ i, extend ((states n).field j) env i ∈ M.sets := Fin.cases valueM members
110
- refine ⟨(states n).field j, valueM, ?_, ?_⟩
111
- · exact (M.realize_historyFieldValueFormula index.succ 0 history.succ j _ extended
112
- states entries n indexEq).2 rfl
113
- · apply (BoundedFormula.realize_toFormula M _ _ extended).2
114
- apply (BoundedFormula.truth_orderedPairFormula output.succ index.succ 0 _).2
115
- change env output = ZFSet.pair (env index) ((states n).field j)
116
- exact equal.trans (congrArg (fun x => ZFSet.pair x ((states n).field j)) indexEq.symm)
117
-
118
- end TransitiveGround
119
-
120
- end PartitionPilot.Forcing
121
-
122
- end
123
-
124
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveStateFieldEnvironments
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+
9
+ universe u
10
+ namespace SetFormula
11
+
12
+ def stateFieldFormula {n} (code value : Fin n) (j : Fin 13) : SetFormula n :=
13
+ exBlock 13 (.conj
14
+ (BoundedFormula.nonemptyTupleFormula 12 (suffixIndex n 13 code) (prefixIndex n 13)).toFormula
15
+ (.equal (suffixIndex n 13 value) (prefixIndex n 13 j)))
16
+
17
+ def historyFieldValueFormula {n} (index value history : Fin n) (j : Fin 13) : SetFormula n :=
18
+ ex (.conj (BoundedFormula.pairMembershipFormula index.succ 0 history.succ).toFormula
19
+ (stateFieldFormula 0 value.succ j))
20
+
21
+ def historyFieldPairFormula {n} (index output history : Fin n) (j : Fin 13) : SetFormula n :=
22
+ ex (.conj (historyFieldValueFormula index.succ 0 history.succ j)
23
+ (BoundedFormula.orderedPairFormula output.succ index.succ 0).toFormula)
24
+
25
+ end SetFormula
26
+
27
+ namespace TransitiveGround
28
+ open SetFormula
29
+ variable (M : TransitiveGround.{u})
30
+
31
+ theorem realize_stateFieldFormula {n} (code value : Fin n) (j : Fin 13)
32
+ (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets)
33
+ (state : RecursiveStateData.{u}) (coded : env code = state.code) :
34
+ Realize M.sets (stateFieldFormula code value j) env ↔ env value = state.field j := by
35
+ rw [stateFieldFormula, realize_exBlock]
36
+ constructor
37
+ · rintro ⟨fields, fieldMembers, tuple, entry⟩
38
+ have equal := (BoundedFormula.truth_nonemptyTupleFormula 12 (suffixIndex n 13 code)
39
+ (prefixIndex n 13) _).1
40
+ ((BoundedFormula.realize_toFormula M _ _ (extendMany_members 13 fields env fieldMembers members)).1 tuple)
41
+ simp only [extendMany_suffix, extendMany_prefix] at equal
42
+ have fieldsEqual : fields = state.field :=
43
+ nonemptyTupleCode_injective 12 (equal.symm.trans coded)
44
+ change extendMany 13 fields env (suffixIndex n 13 value) =
45
+ extendMany 13 fields env (prefixIndex n 13 j) at entry
46
+ simpa only [extendMany_suffix, extendMany_prefix, fieldsEqual] using entry
47
+ · intro equal
48
+ have fieldMembers := M.recursiveStateData_field_mem state (coded ▸ members code)
49
+ refine ⟨state.field, fieldMembers, ?_, ?_⟩
50
+ · apply (BoundedFormula.realize_toFormula M _ _
51
+ (extendMany_members 13 state.field env fieldMembers members)).2
52
+ apply (BoundedFormula.truth_nonemptyTupleFormula 12 (suffixIndex n 13 code)
53
+ (prefixIndex n 13) _).2
54
+ simp only [extendMany_suffix, extendMany_prefix]
55
+ exact coded
56
+ · change extendMany 13 state.field env (suffixIndex n 13 value) =
57
+ extendMany 13 state.field env (prefixIndex n 13 j)
58
+ simpa only [extendMany_suffix, extendMany_prefix] using equal
59
+
60
+ theorem realize_historyFieldValueFormula {k} (index value history : Fin k) (j : Fin 13)
61
+ (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets)
62
+ (states : Nat → RecursiveStateData.{u})
63
+ (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ env history ↔ y = (states n).code)
64
+ (n : Nat) (indexEq : env index = natSetCode n) :
65
+ Realize M.sets (historyFieldValueFormula index value history j) env ↔
66
+ env value = (states n).field j := by
67
+ rw [historyFieldValueFormula, realize_ex]
68
+ constructor
69
+ · rintro ⟨code, hcode, entry, projected⟩
70
+ have extended : ∀ i, extend code env i ∈ M.sets := Fin.cases hcode members
71
+ have actual := (BoundedFormula.truth_pairMembershipFormula index.succ 0 history.succ _).1
72
+ ((BoundedFormula.realize_toFormula M _ _ extended).1 entry)
73
+ change ZFSet.pair (env index) code ∈ env history at actual
74
+ rw [indexEq] at actual
75
+ exact (M.realize_stateFieldFormula 0 value.succ j (extend code env) extended
76
+ (states n) ((entries n code).1 actual)).1 projected
77
+ · intro equal
78
+ have entry : ZFSet.pair (natSetCode n) (states n).code ∈ env history :=
79
+ (entries n _).2 rfl
80
+ have hcode := M.pair_right (M.transitive (members history) entry)
81
+ have extended : ∀ i, extend (states n).code env i ∈ M.sets := Fin.cases hcode members
82
+ refine ⟨(states n).code, hcode, ?_, ?_⟩
83
+ · apply (BoundedFormula.realize_toFormula M _ _ extended).2
84
+ apply (BoundedFormula.truth_pairMembershipFormula index.succ 0 history.succ _).2
85
+ change ZFSet.pair (env index) (states n).code ∈ env history
86
+ exact indexEq.symm ▸ entry
87
+ · exact (M.realize_stateFieldFormula 0 value.succ j _ extended (states n) rfl).2 equal
88
+
89
+ theorem realize_historyFieldPairFormula {k} (index output history : Fin k) (j : Fin 13)
90
+ (env : Fin k → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets)
91
+ (states : Nat → RecursiveStateData.{u})
92
+ (entries : ∀ n y, ZFSet.pair (natSetCode n) y ∈ env history ↔ y = (states n).code)
93
+ (n : Nat) (indexEq : env index = natSetCode n) :
94
+ Realize M.sets (historyFieldPairFormula index output history j) env ↔
95
+ env output = ZFSet.pair (natSetCode n) ((states n).field j) := by
96
+ rw [historyFieldPairFormula, realize_ex]
97
+ constructor
98
+ · rintro ⟨value, hvalue, specified, pair⟩
99
+ have extended : ∀ i, extend value env i ∈ M.sets := Fin.cases hvalue members
100
+ have valueEq := (M.realize_historyFieldValueFormula index.succ 0 history.succ j
101
+ (extend value env) extended states entries n indexEq).1 specified
102
+ have pairEq := (BoundedFormula.truth_orderedPairFormula output.succ index.succ 0 _).1
103
+ ((BoundedFormula.realize_toFormula M _ _ extended).1 pair)
104
+ change env output = ZFSet.pair (env index) value at pairEq
105
+ exact pairEq.trans (congrArg₂ ZFSet.pair indexEq valueEq)
106
+ · intro equal
107
+ have codeM := M.pair_right (M.transitive (members history) ((entries n _).2 rfl))
108
+ have valueM := M.recursiveStateData_field_mem (states n) codeM j
109
+ have extended : ∀ i, extend ((states n).field j) env i ∈ M.sets := Fin.cases valueM members
110
+ refine ⟨(states n).field j, valueM, ?_, ?_⟩
111
+ · exact (M.realize_historyFieldValueFormula index.succ 0 history.succ j _ extended
112
+ states entries n indexEq).2 rfl
113
+ · apply (BoundedFormula.realize_toFormula M _ _ extended).2
114
+ apply (BoundedFormula.truth_orderedPairFormula output.succ index.succ 0 _).2
115
+ change env output = ZFSet.pair (env index) ((states n).field j)
116
+ exact equal.trans (congrArg (fun x => ZFSet.pair x ((states n).field j)) indexEq.symm)
117
+
118
+ end TransitiveGround
119
+
120
+ end PartitionPilot.Forcing
121
+
122
+ end
123
+
124
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedAttachmentCodes.lean CHANGED
@@ -1,228 +1,228 @@
1
- import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageFromCodes
2
-
3
- namespace OAI
4
-
5
- open scoped ZFSet
6
-
7
- namespace PartitionPilot.Forcing
8
-
9
- universe u
10
-
11
- noncomputable def attachmentIdeal (Q rQ a : ZFSet.{u}) : ZFSet.{u} :=
12
- ZFSet.sep (fun q => ZFSet.pair q a ∈ rQ) Q
13
-
14
- noncomputable def freshPart (Q rQ a : ZFSet.{u}) : ZFSet.{u} :=
15
- ZFSet.sep (fun q => ZFSet.pair q a ∉ rQ) Q
16
-
17
- theorem mem_attachmentIdeal (Q rQ a q : ZFSet.{u}) :
18
- q ∈ attachmentIdeal Q rQ a ↔ q ∈ Q ∧ ZFSet.pair q a ∈ rQ :=
19
- ZFSet.mem_sep
20
-
21
- theorem mem_freshPart (Q rQ a q : ZFSet.{u}) :
22
- q ∈ freshPart Q rQ a ↔ q ∈ Q ∧ ZFSet.pair q a ∉ rQ :=
23
- ZFSet.mem_sep
24
-
25
- theorem attachmentIdeal_union_freshPart (Q rQ a : ZFSet.{u}) :
26
- attachmentIdeal Q rQ a ∪ freshPart Q rQ a = Q := by
27
- classical
28
- apply ZFSet.ext
29
- intro q
30
- simp only [ZFSet.mem_union, mem_attachmentIdeal, mem_freshPart]
31
- exact ⟨fun h => h.elim And.left And.left, fun h =>
32
- (Classical.em (ZFSet.pair q a ∈ rQ)).elim
33
- (fun rel => Or.inl ⟨h, rel⟩) (fun rel => Or.inr ⟨h, rel⟩)⟩
34
-
35
- theorem attachmentIdeal_not_freshPart {Q rQ a q : ZFSet.{u}}
36
- (hq : q ∈ attachmentIdeal Q rQ a) : q ∉ freshPart Q rQ a := by
37
- intro fresh
38
- exact ((mem_freshPart Q rQ a q).1 fresh).2 ((mem_attachmentIdeal Q rQ a q).1 hq).2
39
-
40
- noncomputable def attachmentShadowGraph (Q P μQ ell a : ZFSet.{u}) : ZFSet.{u} :=
41
- ZFSet.sep (fun z => ∃ q ∈ Q, ∃ p ∈ P, z = ZFSet.pair q p ∧
42
- ∃ c ∈ Q, ZFSet.pair (ZFSet.pair q a) c ∈ μQ ∧ ZFSet.pair c p ∈ ell)
43
- (ZFSet.prod Q P)
44
-
45
- theorem mem_attachmentShadowGraph (Q P μQ ell a z : ZFSet.{u}) :
46
- z ∈ attachmentShadowGraph Q P μQ ell a ↔
47
- ∃ q ∈ Q, ∃ p ∈ P, z = ZFSet.pair q p ∧
48
- ∃ c ∈ Q, ZFSet.pair (ZFSet.pair q a) c ∈ μQ ∧ ZFSet.pair c p ∈ ell := by
49
- rw [attachmentShadowGraph, ZFSet.mem_sep]
50
- exact ⟨And.right, fun h => ⟨by
51
- obtain ⟨q, hq, p, hp, rfl, _⟩ := h
52
- exact ZFSet.pair_mem_prod.2 ⟨hq, hp⟩, h⟩⟩
53
-
54
- theorem pair_mem_attachmentShadowGraph (Q P μQ ell a q p : ZFSet.{u}) :
55
- ZFSet.pair q p ∈ attachmentShadowGraph Q P μQ ell a ↔
56
- q ∈ Q ∧ p ∈ P ∧
57
- ∃ c ∈ Q, ZFSet.pair (ZFSet.pair q a) c ∈ μQ ∧ ZFSet.pair c p ∈ ell := by
58
- rw [mem_attachmentShadowGraph]
59
- constructor
60
- · rintro ⟨q', hq, p', hp, equal, c, hc, meet, image⟩
61
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
62
- exact ⟨hq, hp, c, hc, meet, image⟩
63
- · rintro ⟨hq, hp, c, hc, meet, image⟩
64
- exact ⟨q, hq, p, hp, rfl, c, hc, meet, image⟩
65
-
66
- theorem meet_entry_in_attachmentIdeal {Q rQ μQ a q c : ZFSet.{u}}
67
- (meet : MeetOrderCode Q rQ μQ)
68
- (entry : ZFSet.pair (ZFSet.pair q a) c ∈ μQ) :
69
- c ∈ attachmentIdeal Q rQ a :=
70
- (mem_attachmentIdeal Q rQ a c).2
71
- ⟨(ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2, meet.lower_right q a c entry⟩
72
-
73
- theorem meet_entry_eq_of_attachmentIdeal {Q rQ μQ a q c : ZFSet.{u}}
74
- (meet : MeetOrderCode Q rQ μQ) (hq : q ∈ attachmentIdeal Q rQ a)
75
- (entry : ZFSet.pair (ZFSet.pair q a) c ∈ μQ) : c = q := by
76
- have inIdeal := (mem_attachmentIdeal Q rQ a q).1 hq
77
- have hc := (ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2
78
- exact meet.order.antisymm c hc q inIdeal.1 (meet.lower_left q a c entry)
79
- (meet.greatest q a c q inIdeal.1 entry (meet.order.refl q inIdeal.1) inIdeal.2)
80
-
81
- theorem attachmentShadowGraph_function {Q P rQ μQ ell a : ZFSet.{u}}
82
- (meet : MeetOrderCode Q rQ μQ) (ha : a ∈ Q)
83
- (ellFunc : ZFSet.IsFunc (attachmentIdeal Q rQ a) P ell) :
84
- ZFSet.IsFunc Q P (attachmentShadowGraph Q P μQ ell a) := by
85
- refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩
86
- intro q hq
87
- obtain ⟨c, entry, meetUnique⟩ := meet.operation.2 (ZFSet.pair q a)
88
- (ZFSet.pair_mem_prod.2 ⟨hq, ha⟩)
89
- have hc := meet_entry_in_attachmentIdeal meet entry
90
- obtain ⟨p, image, imageUnique⟩ := ellFunc.2 c hc
91
- have hp := (ZFSet.pair_mem_prod.1 (ellFunc.1 image)).2
92
- refine ⟨p, (pair_mem_attachmentShadowGraph Q P μQ ell a q p).2
93
- ⟨hq, hp, c, ((mem_attachmentIdeal Q rQ a c).1 hc).1, entry, image⟩, ?_⟩
94
- intro p' shadow
95
- obtain ⟨_, _, c', _, entry', image'⟩ :=
96
- (pair_mem_attachmentShadowGraph Q P μQ ell a q p').1 shadow
97
- have equal := meetUnique c' entry'
98
- subst c'
99
- exact imageUnique p' image'
100
-
101
- theorem attachmentShadowGraph_on_ideal {Q P rQ μQ ell a q p : ZFSet.{u}}
102
- (meet : MeetOrderCode Q rQ μQ) (ha : a ∈ Q)
103
- (ellFunc : ZFSet.IsFunc (attachmentIdeal Q rQ a) P ell)
104
- (hq : q ∈ attachmentIdeal Q rQ a) :
105
- ZFSet.pair q p ∈ attachmentShadowGraph Q P μQ ell a ↔ ZFSet.pair q p ∈ ell := by
106
- constructor
107
- · intro shadow
108
- obtain ⟨_, _, c, _, entry, image⟩ :=
109
- (pair_mem_attachmentShadowGraph Q P μQ ell a q p).1 shadow
110
- exact meet_entry_eq_of_attachmentIdeal meet hq entry ▸ image
111
- · intro image
112
- have qQ := ((mem_attachmentIdeal Q rQ a q).1 hq).1
113
- obtain ⟨c, entry, _⟩ := meet.operation.2 (ZFSet.pair q a)
114
- (ZFSet.pair_mem_prod.2 ⟨qQ, ha⟩)
115
- have equal := meet_entry_eq_of_attachmentIdeal meet hq entry
116
- subst c
117
- exact (pair_mem_attachmentShadowGraph Q P μQ ell a q p).2
118
- ⟨qQ, (ZFSet.pair_mem_prod.1 (ellFunc.1 image)).2, q, qQ, entry, image⟩
119
-
120
- def familyPointBound (Qs : ZFSet.{u}) : ZFSet.{u} := ⋃₀ ⋃₀ ⋃₀ Qs
121
-
122
- theorem mem_familyPointBound_of_entry {Qs i Q q : ZFSet.{u}}
123
- (entry : ZFSet.pair i Q ∈ Qs) (hq : q ∈ Q) : q ∈ familyPointBound Qs :=
124
- ZFSet.mem_sUnion.2 ⟨Q, pair_second_mem_doubleUnion entry, hq⟩
125
-
126
- noncomputable def indexedAttachmentDomain (I Qs : ZFSet.{u}) : ZFSet.{u} :=
127
- ZFSet.sep (fun z => ∃ i ∈ I, ∃ Q ∈ ⋃₀ ⋃₀ Qs, ∃ q ∈ Q,
128
- ZFSet.pair i Q ∈ Qs ∧ z = ZFSet.pair i q)
129
- (ZFSet.prod I (familyPointBound Qs))
130
-
131
- noncomputable def indexedAttachmentFresh (I Qs rs anchors : ZFSet.{u}) : ZFSet.{u} :=
132
- ZFSet.sep (fun z => ∃ i ∈ I, ∃ Q ∈ ⋃₀ ⋃₀ Qs, ∃ r ∈ ⋃₀ ⋃₀ rs,
133
- ∃ a ∈ ⋃₀ ⋃₀ anchors, ∃ q ∈ Q,
134
- ZFSet.pair i Q ∈ Qs ∧ ZFSet.pair i r ∈ rs ∧ ZFSet.pair i a ∈ anchors ∧
135
- z = ZFSet.pair i q ∧ ZFSet.pair q a ∉ r)
136
- (indexedAttachmentDomain I Qs)
137
-
138
- theorem indexedAttachmentDomain_subset (I Qs : ZFSet.{u}) :
139
- indexedAttachmentDomain I Qs ⊆ ZFSet.prod I (familyPointBound Qs) :=
140
- fun _ hz => (ZFSet.mem_sep.1 hz).1
141
-
142
- theorem indexedAttachmentFresh_subset (I Qs rs anchors : ZFSet.{u}) :
143
- indexedAttachmentFresh I Qs rs anchors ⊆ indexedAttachmentDomain I Qs :=
144
- fun _ hz => (ZFSet.mem_sep.1 hz).1
145
-
146
- theorem mem_indexedAttachmentDomain (I Qs z : ZFSet.{u}) :
147
- z ∈ indexedAttachmentDomain I Qs ↔
148
- ∃ i ∈ I, ∃ q, z = ZFSet.pair i q ∧ ∃ Q, ZFSet.pair i Q ∈ Qs ∧ q ∈ Q := by
149
- constructor
150
- · intro hz
151
- obtain ⟨i, hi, Q, _, q, hq, entry, equal⟩ := (ZFSet.mem_sep.1 hz).2
152
- exact ⟨i, hi, q, equal, Q, entry, hq⟩
153
- · rintro ⟨i, hi, q, rfl, Q, entry, hq⟩
154
- exact ZFSet.mem_sep.2
155
- ⟨ZFSet.pair_mem_prod.2 ⟨hi, mem_familyPointBound_of_entry entry hq⟩,
156
- i, hi, Q, pair_second_mem_doubleUnion entry, q, hq, entry, rfl⟩
157
-
158
- theorem pair_mem_indexedAttachmentDomain (I Qs i q : ZFSet.{u}) :
159
- ZFSet.pair i q ∈ indexedAttachmentDomain I Qs ↔
160
- i ∈ I ∧ ∃ Q, ZFSet.pair i Q ∈ Qs ∧ q ∈ Q := by
161
- rw [mem_indexedAttachmentDomain]
162
- constructor
163
- · rintro ⟨j, hj, p, equal, Q, entry, hq⟩
164
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
165
- exact ⟨hj, Q, entry, hq⟩
166
- · rintro ⟨hi, Q, entry, hq⟩
167
- exact ⟨i, hi, q, rfl, Q, entry, hq⟩
168
-
169
- theorem mem_indexedAttachmentFresh (I Qs rs anchors z : ZFSet.{u}) :
170
- z ∈ indexedAttachmentFresh I Qs rs anchors ↔
171
- ∃ i ∈ I, ∃ q, z = ZFSet.pair i q ∧ ∃ Q r a,
172
- ZFSet.pair i Q ∈ Qs ∧ ZFSet.pair i r ∈ rs ∧ ZFSet.pair i a ∈ anchors ∧
173
- q ∈ Q ∧ ZFSet.pair q a ∉ r := by
174
- constructor
175
- · intro hz
176
- obtain ⟨i, hi, Q, _, r, _, a, _, q, hq, entryQ, entryR, entryA, equal, fresh⟩ :=
177
- (ZFSet.mem_sep.1 hz).2
178
- exact ⟨i, hi, q, equal, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩
179
- · rintro ⟨i, hi, q, rfl, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩
180
- exact ZFSet.mem_sep.2
181
- ⟨(pair_mem_indexedAttachmentDomain I Qs i q).2 ⟨hi, Q, entryQ, hq⟩,
182
- i, hi, Q, pair_second_mem_doubleUnion entryQ, r, pair_second_mem_doubleUnion entryR,
183
- a, pair_second_mem_doubleUnion entryA, q, hq, entryQ, entryR, entryA, rfl, fresh⟩
184
-
185
- theorem pair_mem_indexedAttachmentFresh (I Qs rs anchors i q : ZFSet.{u}) :
186
- ZFSet.pair i q ∈ indexedAttachmentFresh I Qs rs anchors ↔
187
- i ∈ I ∧ ∃ Q r a, ZFSet.pair i Q ∈ Qs ∧ ZFSet.pair i r ∈ rs ∧
188
- ZFSet.pair i a ∈ anchors ∧ q ∈ Q ∧ ZFSet.pair q a ∉ r := by
189
- rw [mem_indexedAttachmentFresh]
190
- constructor
191
- · rintro ⟨j, hj, p, equal, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩
192
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
193
- exact ⟨hj, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩
194
- · rintro ⟨hi, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩
195
- exact ⟨i, hi, q, rfl, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩
196
-
197
- theorem pair_mem_indexedAttachmentDomain_of_entry {I Qs i q Q : ZFSet.{u}}
198
- (family : FunctionGraphOn I Qs) (entry : ZFSet.pair i Q ∈ Qs) :
199
- ZFSet.pair i q ∈ indexedAttachmentDomain I Qs ↔ q ∈ Q := by
200
- rw [pair_mem_indexedAttachmentDomain]
201
- constructor
202
- · rintro ⟨_, R, other, hq⟩
203
- exact family.unique other entry ▸ hq
204
- · intro hq
205
- exact ⟨family.pair_source entry, Q, entry, hq⟩
206
-
207
- theorem pair_mem_indexedAttachmentFresh_of_entries
208
- {I Qs rs anchors i q Q r a : ZFSet.{u}}
209
- (spaces : FunctionGraphOn I Qs) (orders : FunctionGraphOn I rs)
210
- (points : FunctionGraphOn I anchors) (entryQ : ZFSet.pair i Q ∈ Qs)
211
- (entryR : ZFSet.pair i r ∈ rs) (entryA : ZFSet.pair i a ∈ anchors) :
212
- ZFSet.pair i q ∈ indexedAttachmentFresh I Qs rs anchors ↔ q ∈ freshPart Q r a := by
213
- rw [pair_mem_indexedAttachmentFresh, mem_freshPart]
214
- constructor
215
- · rintro ⟨_, Q', r', a', otherQ, otherR, otherA, hq, fresh⟩
216
- have equalQ := spaces.unique otherQ entryQ
217
- have equalR := orders.unique otherR entryR
218
- have equalA := points.unique otherA entryA
219
- subst Q'
220
- subst r'
221
- subst a'
222
- exact ⟨hq, fresh⟩
223
- · rintro ⟨hq, fresh⟩
224
- exact ⟨spaces.pair_source entryQ, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩
225
-
226
- end PartitionPilot.Forcing
227
-
228
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageFromCodes
2
+
3
+ namespace OAI
4
+
5
+ open scoped ZFSet
6
+
7
+ namespace PartitionPilot.Forcing
8
+
9
+ universe u
10
+
11
+ noncomputable def attachmentIdeal (Q rQ a : ZFSet.{u}) : ZFSet.{u} :=
12
+ ZFSet.sep (fun q => ZFSet.pair q a ∈ rQ) Q
13
+
14
+ noncomputable def freshPart (Q rQ a : ZFSet.{u}) : ZFSet.{u} :=
15
+ ZFSet.sep (fun q => ZFSet.pair q a ∉ rQ) Q
16
+
17
+ theorem mem_attachmentIdeal (Q rQ a q : ZFSet.{u}) :
18
+ q ∈ attachmentIdeal Q rQ a ↔ q ∈ Q ∧ ZFSet.pair q a ∈ rQ :=
19
+ ZFSet.mem_sep
20
+
21
+ theorem mem_freshPart (Q rQ a q : ZFSet.{u}) :
22
+ q ∈ freshPart Q rQ a ↔ q ∈ Q ∧ ZFSet.pair q a ∉ rQ :=
23
+ ZFSet.mem_sep
24
+
25
+ theorem attachmentIdeal_union_freshPart (Q rQ a : ZFSet.{u}) :
26
+ attachmentIdeal Q rQ a ∪ freshPart Q rQ a = Q := by
27
+ classical
28
+ apply ZFSet.ext
29
+ intro q
30
+ simp only [ZFSet.mem_union, mem_attachmentIdeal, mem_freshPart]
31
+ exact ⟨fun h => h.elim And.left And.left, fun h =>
32
+ (Classical.em (ZFSet.pair q a ∈ rQ)).elim
33
+ (fun rel => Or.inl ⟨h, rel⟩) (fun rel => Or.inr ⟨h, rel⟩)⟩
34
+
35
+ theorem attachmentIdeal_not_freshPart {Q rQ a q : ZFSet.{u}}
36
+ (hq : q ∈ attachmentIdeal Q rQ a) : q ∉ freshPart Q rQ a := by
37
+ intro fresh
38
+ exact ((mem_freshPart Q rQ a q).1 fresh).2 ((mem_attachmentIdeal Q rQ a q).1 hq).2
39
+
40
+ noncomputable def attachmentShadowGraph (Q P μQ ell a : ZFSet.{u}) : ZFSet.{u} :=
41
+ ZFSet.sep (fun z => ∃ q ∈ Q, ∃ p ∈ P, z = ZFSet.pair q p ∧
42
+ ∃ c ∈ Q, ZFSet.pair (ZFSet.pair q a) c ∈ μQ ∧ ZFSet.pair c p ∈ ell)
43
+ (ZFSet.prod Q P)
44
+
45
+ theorem mem_attachmentShadowGraph (Q P μQ ell a z : ZFSet.{u}) :
46
+ z ∈ attachmentShadowGraph Q P μQ ell a ↔
47
+ ∃ q ∈ Q, ∃ p ∈ P, z = ZFSet.pair q p ∧
48
+ ∃ c ∈ Q, ZFSet.pair (ZFSet.pair q a) c ∈ μQ ∧ ZFSet.pair c p ∈ ell := by
49
+ rw [attachmentShadowGraph, ZFSet.mem_sep]
50
+ exact ⟨And.right, fun h => ⟨by
51
+ obtain ⟨q, hq, p, hp, rfl, _⟩ := h
52
+ exact ZFSet.pair_mem_prod.2 ⟨hq, hp⟩, h⟩⟩
53
+
54
+ theorem pair_mem_attachmentShadowGraph (Q P μQ ell a q p : ZFSet.{u}) :
55
+ ZFSet.pair q p ∈ attachmentShadowGraph Q P μQ ell a ↔
56
+ q ∈ Q ∧ p ∈ P ∧
57
+ ∃ c ∈ Q, ZFSet.pair (ZFSet.pair q a) c ∈ μQ ∧ ZFSet.pair c p ∈ ell := by
58
+ rw [mem_attachmentShadowGraph]
59
+ constructor
60
+ · rintro ⟨q', hq, p', hp, equal, c, hc, meet, image⟩
61
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
62
+ exact ⟨hq, hp, c, hc, meet, image⟩
63
+ · rintro ⟨hq, hp, c, hc, meet, image⟩
64
+ exact ⟨q, hq, p, hp, rfl, c, hc, meet, image⟩
65
+
66
+ theorem meet_entry_in_attachmentIdeal {Q rQ μQ a q c : ZFSet.{u}}
67
+ (meet : MeetOrderCode Q rQ μQ)
68
+ (entry : ZFSet.pair (ZFSet.pair q a) c ∈ μQ) :
69
+ c ∈ attachmentIdeal Q rQ a :=
70
+ (mem_attachmentIdeal Q rQ a c).2
71
+ ⟨(ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2, meet.lower_right q a c entry⟩
72
+
73
+ theorem meet_entry_eq_of_attachmentIdeal {Q rQ μQ a q c : ZFSet.{u}}
74
+ (meet : MeetOrderCode Q rQ μQ) (hq : q ∈ attachmentIdeal Q rQ a)
75
+ (entry : ZFSet.pair (ZFSet.pair q a) c ∈ μQ) : c = q := by
76
+ have inIdeal := (mem_attachmentIdeal Q rQ a q).1 hq
77
+ have hc := (ZFSet.pair_mem_prod.1 (meet.operation.1 entry)).2
78
+ exact meet.order.antisymm c hc q inIdeal.1 (meet.lower_left q a c entry)
79
+ (meet.greatest q a c q inIdeal.1 entry (meet.order.refl q inIdeal.1) inIdeal.2)
80
+
81
+ theorem attachmentShadowGraph_function {Q P rQ μQ ell a : ZFSet.{u}}
82
+ (meet : MeetOrderCode Q rQ μQ) (ha : a ∈ Q)
83
+ (ellFunc : ZFSet.IsFunc (attachmentIdeal Q rQ a) P ell) :
84
+ ZFSet.IsFunc Q P (attachmentShadowGraph Q P μQ ell a) := by
85
+ refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩
86
+ intro q hq
87
+ obtain ⟨c, entry, meetUnique⟩ := meet.operation.2 (ZFSet.pair q a)
88
+ (ZFSet.pair_mem_prod.2 ⟨hq, ha⟩)
89
+ have hc := meet_entry_in_attachmentIdeal meet entry
90
+ obtain ⟨p, image, imageUnique⟩ := ellFunc.2 c hc
91
+ have hp := (ZFSet.pair_mem_prod.1 (ellFunc.1 image)).2
92
+ refine ⟨p, (pair_mem_attachmentShadowGraph Q P μQ ell a q p).2
93
+ ⟨hq, hp, c, ((mem_attachmentIdeal Q rQ a c).1 hc).1, entry, image⟩, ?_⟩
94
+ intro p' shadow
95
+ obtain ⟨_, _, c', _, entry', image'⟩ :=
96
+ (pair_mem_attachmentShadowGraph Q P μQ ell a q p').1 shadow
97
+ have equal := meetUnique c' entry'
98
+ subst c'
99
+ exact imageUnique p' image'
100
+
101
+ theorem attachmentShadowGraph_on_ideal {Q P rQ μQ ell a q p : ZFSet.{u}}
102
+ (meet : MeetOrderCode Q rQ μQ) (ha : a ∈ Q)
103
+ (ellFunc : ZFSet.IsFunc (attachmentIdeal Q rQ a) P ell)
104
+ (hq : q ∈ attachmentIdeal Q rQ a) :
105
+ ZFSet.pair q p ∈ attachmentShadowGraph Q P μQ ell a ↔ ZFSet.pair q p ∈ ell := by
106
+ constructor
107
+ · intro shadow
108
+ obtain ⟨_, _, c, _, entry, image⟩ :=
109
+ (pair_mem_attachmentShadowGraph Q P μQ ell a q p).1 shadow
110
+ exact meet_entry_eq_of_attachmentIdeal meet hq entry ▸ image
111
+ · intro image
112
+ have qQ := ((mem_attachmentIdeal Q rQ a q).1 hq).1
113
+ obtain ⟨c, entry, _⟩ := meet.operation.2 (ZFSet.pair q a)
114
+ (ZFSet.pair_mem_prod.2 ⟨qQ, ha⟩)
115
+ have equal := meet_entry_eq_of_attachmentIdeal meet hq entry
116
+ subst c
117
+ exact (pair_mem_attachmentShadowGraph Q P μQ ell a q p).2
118
+ ⟨qQ, (ZFSet.pair_mem_prod.1 (ellFunc.1 image)).2, q, qQ, entry, image⟩
119
+
120
+ def familyPointBound (Qs : ZFSet.{u}) : ZFSet.{u} := ⋃₀ ⋃₀ ⋃₀ Qs
121
+
122
+ theorem mem_familyPointBound_of_entry {Qs i Q q : ZFSet.{u}}
123
+ (entry : ZFSet.pair i Q ∈ Qs) (hq : q ∈ Q) : q ∈ familyPointBound Qs :=
124
+ ZFSet.mem_sUnion.2 ⟨Q, pair_second_mem_doubleUnion entry, hq⟩
125
+
126
+ noncomputable def indexedAttachmentDomain (I Qs : ZFSet.{u}) : ZFSet.{u} :=
127
+ ZFSet.sep (fun z => ∃ i ∈ I, ∃ Q ∈ ⋃₀ ⋃₀ Qs, ∃ q ∈ Q,
128
+ ZFSet.pair i Q ∈ Qs ∧ z = ZFSet.pair i q)
129
+ (ZFSet.prod I (familyPointBound Qs))
130
+
131
+ noncomputable def indexedAttachmentFresh (I Qs rs anchors : ZFSet.{u}) : ZFSet.{u} :=
132
+ ZFSet.sep (fun z => ∃ i ∈ I, ∃ Q ∈ ⋃₀ ⋃₀ Qs, ∃ r ∈ ⋃₀ ⋃₀ rs,
133
+ ∃ a ∈ ⋃₀ ⋃₀ anchors, ∃ q ∈ Q,
134
+ ZFSet.pair i Q ∈ Qs ∧ ZFSet.pair i r ∈ rs ∧ ZFSet.pair i a ∈ anchors ∧
135
+ z = ZFSet.pair i q ∧ ZFSet.pair q a ∉ r)
136
+ (indexedAttachmentDomain I Qs)
137
+
138
+ theorem indexedAttachmentDomain_subset (I Qs : ZFSet.{u}) :
139
+ indexedAttachmentDomain I Qs ⊆ ZFSet.prod I (familyPointBound Qs) :=
140
+ fun _ hz => (ZFSet.mem_sep.1 hz).1
141
+
142
+ theorem indexedAttachmentFresh_subset (I Qs rs anchors : ZFSet.{u}) :
143
+ indexedAttachmentFresh I Qs rs anchors ⊆ indexedAttachmentDomain I Qs :=
144
+ fun _ hz => (ZFSet.mem_sep.1 hz).1
145
+
146
+ theorem mem_indexedAttachmentDomain (I Qs z : ZFSet.{u}) :
147
+ z ∈ indexedAttachmentDomain I Qs ↔
148
+ ∃ i ∈ I, ∃ q, z = ZFSet.pair i q ∧ ∃ Q, ZFSet.pair i Q ∈ Qs ∧ q ∈ Q := by
149
+ constructor
150
+ · intro hz
151
+ obtain ⟨i, hi, Q, _, q, hq, entry, equal⟩ := (ZFSet.mem_sep.1 hz).2
152
+ exact ⟨i, hi, q, equal, Q, entry, hq⟩
153
+ · rintro ⟨i, hi, q, rfl, Q, entry, hq⟩
154
+ exact ZFSet.mem_sep.2
155
+ ⟨ZFSet.pair_mem_prod.2 ⟨hi, mem_familyPointBound_of_entry entry hq⟩,
156
+ i, hi, Q, pair_second_mem_doubleUnion entry, q, hq, entry, rfl⟩
157
+
158
+ theorem pair_mem_indexedAttachmentDomain (I Qs i q : ZFSet.{u}) :
159
+ ZFSet.pair i q ∈ indexedAttachmentDomain I Qs ↔
160
+ i ∈ I ∧ ∃ Q, ZFSet.pair i Q ∈ Qs ∧ q ∈ Q := by
161
+ rw [mem_indexedAttachmentDomain]
162
+ constructor
163
+ · rintro ⟨j, hj, p, equal, Q, entry, hq⟩
164
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
165
+ exact ⟨hj, Q, entry, hq⟩
166
+ · rintro ⟨hi, Q, entry, hq⟩
167
+ exact ⟨i, hi, q, rfl, Q, entry, hq⟩
168
+
169
+ theorem mem_indexedAttachmentFresh (I Qs rs anchors z : ZFSet.{u}) :
170
+ z ∈ indexedAttachmentFresh I Qs rs anchors ↔
171
+ ∃ i ∈ I, ∃ q, z = ZFSet.pair i q ∧ ∃ Q r a,
172
+ ZFSet.pair i Q ∈ Qs ∧ ZFSet.pair i r ∈ rs ∧ ZFSet.pair i a ∈ anchors ∧
173
+ q ∈ Q ∧ ZFSet.pair q a ∉ r := by
174
+ constructor
175
+ · intro hz
176
+ obtain ⟨i, hi, Q, _, r, _, a, _, q, hq, entryQ, entryR, entryA, equal, fresh⟩ :=
177
+ (ZFSet.mem_sep.1 hz).2
178
+ exact ⟨i, hi, q, equal, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩
179
+ · rintro ⟨i, hi, q, rfl, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩
180
+ exact ZFSet.mem_sep.2
181
+ ⟨(pair_mem_indexedAttachmentDomain I Qs i q).2 ⟨hi, Q, entryQ, hq⟩,
182
+ i, hi, Q, pair_second_mem_doubleUnion entryQ, r, pair_second_mem_doubleUnion entryR,
183
+ a, pair_second_mem_doubleUnion entryA, q, hq, entryQ, entryR, entryA, rfl, fresh⟩
184
+
185
+ theorem pair_mem_indexedAttachmentFresh (I Qs rs anchors i q : ZFSet.{u}) :
186
+ ZFSet.pair i q ∈ indexedAttachmentFresh I Qs rs anchors ↔
187
+ i ∈ I ∧ ∃ Q r a, ZFSet.pair i Q ∈ Qs ∧ ZFSet.pair i r ∈ rs ∧
188
+ ZFSet.pair i a ∈ anchors ∧ q ∈ Q ∧ ZFSet.pair q a ∉ r := by
189
+ rw [mem_indexedAttachmentFresh]
190
+ constructor
191
+ · rintro ⟨j, hj, p, equal, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩
192
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
193
+ exact ⟨hj, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩
194
+ · rintro ⟨hi, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩
195
+ exact ⟨i, hi, q, rfl, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩
196
+
197
+ theorem pair_mem_indexedAttachmentDomain_of_entry {I Qs i q Q : ZFSet.{u}}
198
+ (family : FunctionGraphOn I Qs) (entry : ZFSet.pair i Q ∈ Qs) :
199
+ ZFSet.pair i q ∈ indexedAttachmentDomain I Qs ↔ q ∈ Q := by
200
+ rw [pair_mem_indexedAttachmentDomain]
201
+ constructor
202
+ · rintro ⟨_, R, other, hq⟩
203
+ exact family.unique other entry ▸ hq
204
+ · intro hq
205
+ exact ⟨family.pair_source entry, Q, entry, hq⟩
206
+
207
+ theorem pair_mem_indexedAttachmentFresh_of_entries
208
+ {I Qs rs anchors i q Q r a : ZFSet.{u}}
209
+ (spaces : FunctionGraphOn I Qs) (orders : FunctionGraphOn I rs)
210
+ (points : FunctionGraphOn I anchors) (entryQ : ZFSet.pair i Q ∈ Qs)
211
+ (entryR : ZFSet.pair i r ∈ rs) (entryA : ZFSet.pair i a ∈ anchors) :
212
+ ZFSet.pair i q ∈ indexedAttachmentFresh I Qs rs anchors ↔ q ∈ freshPart Q r a := by
213
+ rw [pair_mem_indexedAttachmentFresh, mem_freshPart]
214
+ constructor
215
+ · rintro ⟨_, Q', r', a', otherQ, otherR, otherA, hq, fresh⟩
216
+ have equalQ := spaces.unique otherQ entryQ
217
+ have equalR := orders.unique otherR entryR
218
+ have equalA := points.unique otherA entryA
219
+ subst Q'
220
+ subst r'
221
+ subst a'
222
+ exact ⟨hq, fresh⟩
223
+ · rintro ⟨hq, fresh⟩
224
+ exact ⟨spaces.pair_source entryQ, Q, r, a, entryQ, entryR, entryA, hq, fresh⟩
225
+
226
+ end PartitionPilot.Forcing
227
+
228
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedMixedOperationLiftCodes.lean CHANGED
@@ -1,58 +1,58 @@
1
- import OAI.SetTheory.PartitionPrinciple.Definability.PresentedGroupCodes
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
- open SetRealization
9
- universe u
10
-
11
- noncomputable def indexedMixedBinaryLift (T UG UP G P A JG JP : ZFSet.{u}) : ZFSet.{u} :=
12
- ZFSet.sep (fun w => ∃ g ∈ G, ∃ p ∈ P, ∃ q ∈ P, ∃ i ∈ T,
13
- ∃ a ∈ ZFSet.sUnion (ZFSet.sUnion A),
14
- ∃ eG ∈ ZFSet.sUnion (ZFSet.sUnion JG), ∃ eP ∈ ZFSet.sUnion (ZFSet.sUnion JP),
15
- ∃ u ∈ UG, ∃ x ∈ UP, ∃ y ∈ UP,
16
- w = ZFSet.pair (ZFSet.pair g p) q ∧
17
- ZFSet.pair i a ∈ A ∧ ZFSet.pair i eG ∈ JG ∧ ZFSet.pair i eP ∈ JP ∧
18
- ZFSet.pair u g ∈ eG ∧ ZFSet.pair x p ∈ eP ∧ ZFSet.pair y q ∈ eP ∧
19
- ZFSet.pair (ZFSet.pair u x) y ∈ a) (ZFSet.prod (ZFSet.prod G P) P)
20
-
21
- theorem indexedMixedBinaryLift_subset (T UG UP G P A JG JP : ZFSet.{u}) :
22
- indexedMixedBinaryLift T UG UP G P A JG JP ⊆ ZFSet.prod (ZFSet.prod G P) P :=
23
- fun _ hz => (ZFSet.mem_sep.1 hz).1
24
-
25
- theorem triple_mem_indexedMixedBinaryLift (T UG UP G P A JG JP g p q : ZFSet.{u}) :
26
- ZFSet.pair (ZFSet.pair g p) q ∈ indexedMixedBinaryLift T UG UP G P A JG JP ↔
27
- g ∈ G ∧ p ∈ P ∧ q ∈ P ∧ ∃ i ∈ T, ∃ a eG eP,
28
- ∃ u ∈ UG, ∃ x ∈ UP, ∃ y ∈ UP,
29
- ZFSet.pair i a ∈ A ∧ ZFSet.pair i eG ∈ JG ∧ ZFSet.pair i eP ∈ JP ∧
30
- ZFSet.pair u g ∈ eG ∧ ZFSet.pair x p ∈ eP ∧ ZFSet.pair y q ∈ eP ∧
31
- ZFSet.pair (ZFSet.pair u x) y ∈ a := by
32
- rw [indexedMixedBinaryLift, ZFSet.mem_sep]
33
- constructor
34
- · rintro ⟨_, g', hg, p', hp, q', hq, i, hi, a, _, eG, _, eP, _,
35
- u, hu, x, hx, y, hy, equal, action, actors, points, actor, first, second, source⟩
36
- obtain ⟨gp, rfl⟩ := ZFSet.pair_inj.1 equal
37
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 gp
38
- exact ⟨hg, hp, hq, i, hi, a, eG, eP, u, hu, x, hx, y, hy,
39
- action, actors, points, actor, first, second, source⟩
40
- · rintro ⟨hg, hp, hq, i, hi, a, eG, eP, u, hu, x, hx, y, hy,
41
- action, actors, points, actor, first, second, source⟩
42
- exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg, hp⟩, hq⟩,
43
- g, hg, p, hp, q, hq, i, hi, a, pair_second_mem_doubleUnion action,
44
- eG, pair_second_mem_doubleUnion actors, eP, pair_second_mem_doubleUnion points,
45
- u, hu, x, hx, y, hy, rfl, action, actors, points, actor, first, second, source⟩
46
-
47
- theorem indexedMixedBinaryLift_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o)
48
- (T UG UP A JG JP : ZFSet.{u}) {G P : ZFSet.{u}}
49
- (actors : ZFSet.rank G < o) (points : ZFSet.rank P < o) :
50
- ZFSet.rank (indexedMixedBinaryLift T UG UP G P A JG JP) < o :=
51
- (ZFSet.rank_mono (indexedMixedBinaryLift_subset T UG UP G P A JG JP)).trans_lt
52
- (rank_product_lt limit (rank_product_lt limit actors points) points)
53
-
54
- end PartitionPilot.Forcing
55
-
56
- end
57
-
58
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Definability.PresentedGroupCodes
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+ open SetRealization
9
+ universe u
10
+
11
+ noncomputable def indexedMixedBinaryLift (T UG UP G P A JG JP : ZFSet.{u}) : ZFSet.{u} :=
12
+ ZFSet.sep (fun w => ∃ g ∈ G, ∃ p ∈ P, ∃ q ∈ P, ∃ i ∈ T,
13
+ ∃ a ∈ ZFSet.sUnion (ZFSet.sUnion A),
14
+ ∃ eG ∈ ZFSet.sUnion (ZFSet.sUnion JG), ∃ eP ∈ ZFSet.sUnion (ZFSet.sUnion JP),
15
+ ∃ u ∈ UG, ∃ x ∈ UP, ∃ y ∈ UP,
16
+ w = ZFSet.pair (ZFSet.pair g p) q ∧
17
+ ZFSet.pair i a ∈ A ∧ ZFSet.pair i eG ∈ JG ∧ ZFSet.pair i eP ∈ JP ∧
18
+ ZFSet.pair u g ∈ eG ∧ ZFSet.pair x p ∈ eP ∧ ZFSet.pair y q ∈ eP ∧
19
+ ZFSet.pair (ZFSet.pair u x) y ∈ a) (ZFSet.prod (ZFSet.prod G P) P)
20
+
21
+ theorem indexedMixedBinaryLift_subset (T UG UP G P A JG JP : ZFSet.{u}) :
22
+ indexedMixedBinaryLift T UG UP G P A JG JP ⊆ ZFSet.prod (ZFSet.prod G P) P :=
23
+ fun _ hz => (ZFSet.mem_sep.1 hz).1
24
+
25
+ theorem triple_mem_indexedMixedBinaryLift (T UG UP G P A JG JP g p q : ZFSet.{u}) :
26
+ ZFSet.pair (ZFSet.pair g p) q ∈ indexedMixedBinaryLift T UG UP G P A JG JP ↔
27
+ g ∈ G ∧ p ∈ P ∧ q ∈ P ∧ ∃ i ∈ T, ∃ a eG eP,
28
+ ∃ u ∈ UG, ∃ x ∈ UP, ∃ y ∈ UP,
29
+ ZFSet.pair i a ∈ A ∧ ZFSet.pair i eG ∈ JG ∧ ZFSet.pair i eP ∈ JP ∧
30
+ ZFSet.pair u g ∈ eG ∧ ZFSet.pair x p ∈ eP ∧ ZFSet.pair y q ∈ eP ∧
31
+ ZFSet.pair (ZFSet.pair u x) y ∈ a := by
32
+ rw [indexedMixedBinaryLift, ZFSet.mem_sep]
33
+ constructor
34
+ · rintro ⟨_, g', hg, p', hp, q', hq, i, hi, a, _, eG, _, eP, _,
35
+ u, hu, x, hx, y, hy, equal, action, actors, points, actor, first, second, source⟩
36
+ obtain ⟨gp, rfl⟩ := ZFSet.pair_inj.1 equal
37
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 gp
38
+ exact ⟨hg, hp, hq, i, hi, a, eG, eP, u, hu, x, hx, y, hy,
39
+ action, actors, points, actor, first, second, source⟩
40
+ · rintro ⟨hg, hp, hq, i, hi, a, eG, eP, u, hu, x, hx, y, hy,
41
+ action, actors, points, actor, first, second, source⟩
42
+ exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hg, hp⟩, hq⟩,
43
+ g, hg, p, hp, q, hq, i, hi, a, pair_second_mem_doubleUnion action,
44
+ eG, pair_second_mem_doubleUnion actors, eP, pair_second_mem_doubleUnion points,
45
+ u, hu, x, hx, y, hy, rfl, action, actors, points, actor, first, second, source⟩
46
+
47
+ theorem indexedMixedBinaryLift_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o)
48
+ (T UG UP A JG JP : ZFSet.{u}) {G P : ZFSet.{u}}
49
+ (actors : ZFSet.rank G < o) (points : ZFSet.rank P < o) :
50
+ ZFSet.rank (indexedMixedBinaryLift T UG UP G P A JG JP) < o :=
51
+ (ZFSet.rank_mono (indexedMixedBinaryLift_subset T UG UP G P A JG JP)).trans_lt
52
+ (rank_product_lt limit (rank_product_lt limit actors points) points)
53
+
54
+ end PartitionPilot.Forcing
55
+
56
+ end
57
+
58
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedOperationLiftCodes.lean CHANGED
@@ -1,86 +1,86 @@
1
- import OAI.SetTheory.PartitionPrinciple.Definability.PresentedGroupCodes
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
- open SetRealization
9
- open scoped ZFSet
10
- universe u
11
-
12
- noncomputable def indexedRelationLift (T U Q R J : ZFSet.{u}) : ZFSet.{u} :=
13
- ZFSet.sep (fun z => ∃ p ∈ Q, ∃ q ∈ Q, ∃ i ∈ T,
14
- ∃ r ∈ ⋃₀ ⋃₀ R, ∃ e ∈ ⋃₀ ⋃₀ J, ∃ x ∈ U, ∃ y ∈ U,
15
- z = ZFSet.pair p q ∧ ZFSet.pair i r ∈ R ∧ ZFSet.pair i e ∈ J ∧
16
- ZFSet.pair x p ∈ e ∧ ZFSet.pair y q ∈ e ∧ ZFSet.pair x y ∈ r)
17
- (ZFSet.prod Q Q)
18
-
19
- theorem indexedRelationLift_subset (T U Q R J : ZFSet.{u}) :
20
- indexedRelationLift T U Q R J ⊆ ZFSet.prod Q Q :=
21
- fun _ hz => (ZFSet.mem_sep.1 hz).1
22
-
23
- theorem pair_mem_indexedRelationLift (T U Q R J p q : ZFSet.{u}) :
24
- ZFSet.pair p q ∈ indexedRelationLift T U Q R J ↔
25
- p ∈ Q ∧ q ∈ Q ∧ ∃ i ∈ T, ∃ r e, ∃ x ∈ U, ∃ y ∈ U,
26
- ZFSet.pair i r ∈ R ∧ ZFSet.pair i e ∈ J ∧
27
- ZFSet.pair x p ∈ e ∧ ZFSet.pair y q ∈ e ∧ ZFSet.pair x y ∈ r := by
28
- rw [indexedRelationLift, ZFSet.mem_sep]
29
- constructor
30
- · rintro ⟨_, p', hp, q', hq, i, hi, r, _, e, _, x, hx, y, hy, equal, relation, inclusion, first, second, source⟩
31
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
32
- exact ⟨hp, hq, i, hi, r, e, x, hx, y, hy, relation, inclusion, first, second, source⟩
33
- · rintro ⟨hp, hq, i, hi, r, e, x, hx, y, hy, relation, inclusion, first, second, source⟩
34
- exact ⟨ZFSet.pair_mem_prod.2 ⟨hp, hq⟩, p, hp, q, hq, i, hi,
35
- r, pair_second_mem_doubleUnion relation, e, pair_second_mem_doubleUnion inclusion,
36
- x, hx, y, hy, rfl, relation, inclusion, first, second, source⟩
37
-
38
- noncomputable def indexedBinaryLift (T U Q B J : ZFSet.{u}) : ZFSet.{u} :=
39
- ZFSet.sep (fun w => ∃ p ∈ Q, ∃ q ∈ Q, ∃ v ∈ Q, ∃ i ∈ T,
40
- ∃ b ∈ ⋃₀ ⋃₀ B, ∃ e ∈ ⋃₀ ⋃₀ J, ∃ x ∈ U, ∃ y ∈ U, ∃ z ∈ U,
41
- w = ZFSet.pair (ZFSet.pair p q) v ∧ ZFSet.pair i b ∈ B ∧ ZFSet.pair i e ∈ J ∧
42
- ZFSet.pair x p ∈ e ∧ ZFSet.pair y q ∈ e ∧ ZFSet.pair z v ∈ e ∧
43
- ZFSet.pair (ZFSet.pair x y) z ∈ b) (ZFSet.prod (ZFSet.prod Q Q) Q)
44
-
45
- theorem indexedBinaryLift_subset (T U Q B J : ZFSet.{u}) :
46
- indexedBinaryLift T U Q B J ⊆ ZFSet.prod (ZFSet.prod Q Q) Q :=
47
- fun _ hz => (ZFSet.mem_sep.1 hz).1
48
-
49
- theorem triple_mem_indexedBinaryLift (T U Q B J p q v : ZFSet.{u}) :
50
- ZFSet.pair (ZFSet.pair p q) v ∈ indexedBinaryLift T U Q B J ↔
51
- p ∈ Q ∧ q ∈ Q ∧ v ∈ Q ∧ ∃ i ∈ T, ∃ b e, ∃ x ∈ U, ∃ y ∈ U, ∃ z ∈ U,
52
- ZFSet.pair i b ∈ B ∧ ZFSet.pair i e ∈ J ∧
53
- ZFSet.pair x p ∈ e ∧ ZFSet.pair y q ∈ e ∧ ZFSet.pair z v ∈ e ∧
54
- ZFSet.pair (ZFSet.pair x y) z ∈ b := by
55
- rw [indexedBinaryLift, ZFSet.mem_sep]
56
- constructor
57
- · rintro ⟨_, p', hp, q', hq, v', hv, i, hi, b, _, e, _, x, hx, y, hy, z, hz,
58
- equal, operation, inclusion, first, second, third, source⟩
59
- obtain ⟨pq, rfl⟩ := ZFSet.pair_inj.1 equal
60
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 pq
61
- exact ⟨hp, hq, hv, i, hi, b, e, x, hx, y, hy, z, hz,
62
- operation, inclusion, first, second, third, source⟩
63
- · rintro ⟨hp, hq, hv, i, hi, b, e, x, hx, y, hy, z, hz,
64
- operation, inclusion, first, second, third, source⟩
65
- exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hp, hq⟩, hv⟩,
66
- p, hp, q, hq, v, hv, i, hi, b, pair_second_mem_doubleUnion operation,
67
- e, pair_second_mem_doubleUnion inclusion, x, hx, y, hy, z, hz,
68
- rfl, operation, inclusion, first, second, third, source⟩
69
-
70
- theorem indexedRelationLift_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o)
71
- (T U R J : ZFSet.{u}) {Q : ZFSet.{u}} (rank : ZFSet.rank Q < o) :
72
- ZFSet.rank (indexedRelationLift T U Q R J) < o :=
73
- (ZFSet.rank_mono (indexedRelationLift_subset T U Q R J)).trans_lt
74
- (rank_product_lt limit rank rank)
75
-
76
- theorem indexedBinaryLift_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o)
77
- (T U B J : ZFSet.{u}) {Q : ZFSet.{u}} (rank : ZFSet.rank Q < o) :
78
- ZFSet.rank (indexedBinaryLift T U Q B J) < o :=
79
- (ZFSet.rank_mono (indexedBinaryLift_subset T U Q B J)).trans_lt
80
- (rank_product_lt limit (rank_product_lt limit rank rank) rank)
81
-
82
- end PartitionPilot.Forcing
83
-
84
- end
85
-
86
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Definability.PresentedGroupCodes
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+ open SetRealization
9
+ open scoped ZFSet
10
+ universe u
11
+
12
+ noncomputable def indexedRelationLift (T U Q R J : ZFSet.{u}) : ZFSet.{u} :=
13
+ ZFSet.sep (fun z => ∃ p ∈ Q, ∃ q ∈ Q, ∃ i ∈ T,
14
+ ∃ r ∈ ⋃₀ ⋃₀ R, ∃ e ∈ ⋃₀ ⋃₀ J, ∃ x ∈ U, ∃ y ∈ U,
15
+ z = ZFSet.pair p q ∧ ZFSet.pair i r ∈ R ∧ ZFSet.pair i e ∈ J ∧
16
+ ZFSet.pair x p ∈ e ∧ ZFSet.pair y q ∈ e ∧ ZFSet.pair x y ∈ r)
17
+ (ZFSet.prod Q Q)
18
+
19
+ theorem indexedRelationLift_subset (T U Q R J : ZFSet.{u}) :
20
+ indexedRelationLift T U Q R J ⊆ ZFSet.prod Q Q :=
21
+ fun _ hz => (ZFSet.mem_sep.1 hz).1
22
+
23
+ theorem pair_mem_indexedRelationLift (T U Q R J p q : ZFSet.{u}) :
24
+ ZFSet.pair p q ∈ indexedRelationLift T U Q R J ↔
25
+ p ∈ Q ∧ q ∈ Q ∧ ∃ i ∈ T, ∃ r e, ∃ x ∈ U, ∃ y ∈ U,
26
+ ZFSet.pair i r ∈ R ∧ ZFSet.pair i e ∈ J ∧
27
+ ZFSet.pair x p ∈ e ∧ ZFSet.pair y q ∈ e ∧ ZFSet.pair x y ∈ r := by
28
+ rw [indexedRelationLift, ZFSet.mem_sep]
29
+ constructor
30
+ · rintro ⟨_, p', hp, q', hq, i, hi, r, _, e, _, x, hx, y, hy, equal, relation, inclusion, first, second, source⟩
31
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
32
+ exact ⟨hp, hq, i, hi, r, e, x, hx, y, hy, relation, inclusion, first, second, source⟩
33
+ · rintro ⟨hp, hq, i, hi, r, e, x, hx, y, hy, relation, inclusion, first, second, source⟩
34
+ exact ⟨ZFSet.pair_mem_prod.2 ⟨hp, hq⟩, p, hp, q, hq, i, hi,
35
+ r, pair_second_mem_doubleUnion relation, e, pair_second_mem_doubleUnion inclusion,
36
+ x, hx, y, hy, rfl, relation, inclusion, first, second, source⟩
37
+
38
+ noncomputable def indexedBinaryLift (T U Q B J : ZFSet.{u}) : ZFSet.{u} :=
39
+ ZFSet.sep (fun w => ∃ p ∈ Q, ∃ q ∈ Q, ∃ v ∈ Q, ∃ i ∈ T,
40
+ ∃ b ∈ ⋃₀ ⋃₀ B, ∃ e ∈ ⋃₀ ⋃₀ J, ∃ x ∈ U, ∃ y ∈ U, ∃ z ∈ U,
41
+ w = ZFSet.pair (ZFSet.pair p q) v ∧ ZFSet.pair i b ∈ B ∧ ZFSet.pair i e ∈ J ∧
42
+ ZFSet.pair x p ∈ e ∧ ZFSet.pair y q ∈ e ∧ ZFSet.pair z v ∈ e ∧
43
+ ZFSet.pair (ZFSet.pair x y) z ∈ b) (ZFSet.prod (ZFSet.prod Q Q) Q)
44
+
45
+ theorem indexedBinaryLift_subset (T U Q B J : ZFSet.{u}) :
46
+ indexedBinaryLift T U Q B J ⊆ ZFSet.prod (ZFSet.prod Q Q) Q :=
47
+ fun _ hz => (ZFSet.mem_sep.1 hz).1
48
+
49
+ theorem triple_mem_indexedBinaryLift (T U Q B J p q v : ZFSet.{u}) :
50
+ ZFSet.pair (ZFSet.pair p q) v ∈ indexedBinaryLift T U Q B J ↔
51
+ p ∈ Q ∧ q ∈ Q ∧ v ∈ Q ∧ ∃ i ∈ T, ∃ b e, ∃ x ∈ U, ∃ y ∈ U, ∃ z ∈ U,
52
+ ZFSet.pair i b ∈ B ∧ ZFSet.pair i e ∈ J ∧
53
+ ZFSet.pair x p ∈ e ∧ ZFSet.pair y q ∈ e ∧ ZFSet.pair z v ∈ e ∧
54
+ ZFSet.pair (ZFSet.pair x y) z ∈ b := by
55
+ rw [indexedBinaryLift, ZFSet.mem_sep]
56
+ constructor
57
+ · rintro ⟨_, p', hp, q', hq, v', hv, i, hi, b, _, e, _, x, hx, y, hy, z, hz,
58
+ equal, operation, inclusion, first, second, third, source⟩
59
+ obtain ⟨pq, rfl⟩ := ZFSet.pair_inj.1 equal
60
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 pq
61
+ exact ⟨hp, hq, hv, i, hi, b, e, x, hx, y, hy, z, hz,
62
+ operation, inclusion, first, second, third, source⟩
63
+ · rintro ⟨hp, hq, hv, i, hi, b, e, x, hx, y, hy, z, hz,
64
+ operation, inclusion, first, second, third, source⟩
65
+ exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hp, hq⟩, hv⟩,
66
+ p, hp, q, hq, v, hv, i, hi, b, pair_second_mem_doubleUnion operation,
67
+ e, pair_second_mem_doubleUnion inclusion, x, hx, y, hy, z, hz,
68
+ rfl, operation, inclusion, first, second, third, source⟩
69
+
70
+ theorem indexedRelationLift_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o)
71
+ (T U R J : ZFSet.{u}) {Q : ZFSet.{u}} (rank : ZFSet.rank Q < o) :
72
+ ZFSet.rank (indexedRelationLift T U Q R J) < o :=
73
+ (ZFSet.rank_mono (indexedRelationLift_subset T U Q R J)).trans_lt
74
+ (rank_product_lt limit rank rank)
75
+
76
+ theorem indexedBinaryLift_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o)
77
+ (T U B J : ZFSet.{u}) {Q : ZFSet.{u}} (rank : ZFSet.rank Q < o) :
78
+ ZFSet.rank (indexedBinaryLift T U Q B J) < o :=
79
+ (ZFSet.rank_mono (indexedBinaryLift_subset T U Q B J)).trans_lt
80
+ (rank_product_lt limit (rank_product_lt limit rank rank) rank)
81
+
82
+ end PartitionPilot.Forcing
83
+
84
+ end
85
+
86
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedSubstructureCodes.lean CHANGED
@@ -1,122 +1,122 @@
1
- import OAI.SetTheory.PartitionPrinciple.Geometry.SeparationTileCodes
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
- open SetFormula
9
- universe u
10
-
11
- def indexedSuborderGraph (I B R domains : ZFSet.{u}) : ZFSet.{u} :=
12
- ZFSet.sep (fun z => ∃ i ∈ I, ∃ v ∈ R, ∃ x ∈ B, ∃ y ∈ B,
13
- z = ZFSet.pair i v ∧ v = ZFSet.pair x y ∧
14
- ZFSet.pair i x ∈ domains ∧ ZFSet.pair i y ∈ domains) (ZFSet.prod I R)
15
-
16
- def indexedSubmeetGraph (I B μ domains : ZFSet.{u}) : ZFSet.{u} :=
17
- ZFSet.sep (fun z => ∃ i ∈ I, ∃ v ∈ μ, ∃ x ∈ B, ∃ y ∈ B, ∃ w ∈ B,
18
- z = ZFSet.pair i v ∧ v = ZFSet.pair (ZFSet.pair x y) w ∧
19
- ZFSet.pair i x ∈ domains ∧ ZFSet.pair i y ∈ domains ∧ ZFSet.pair i w ∈ domains)
20
- (ZFSet.prod I μ)
21
-
22
- theorem pair_mem_indexedSuborderGraph (I B R domains i v : ZFSet.{u}) :
23
- ZFSet.pair i v ∈ indexedSuborderGraph I B R domains ↔
24
- i ∈ I ∧ v ∈ R ∧ ∃ x ∈ relationFiber B domains i, ∃ y ∈ relationFiber B domains i,
25
- v = ZFSet.pair x y := by
26
- rw [indexedSuborderGraph, ZFSet.mem_sep]
27
- constructor
28
- · rintro ⟨_, j, hj, w, hw, x, hx, y, hy, equal, value, first, second⟩
29
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
30
- exact ⟨hj, hw, x, (mem_relationFiber _ _ _ _).2 ⟨hx, first⟩,
31
- y, (mem_relationFiber _ _ _ _).2 ⟨hy, second⟩, value⟩
32
- · rintro ⟨hi, hv, x, hx, y, hy, equal⟩
33
- obtain ⟨hx, first⟩ := (mem_relationFiber _ _ _ _).1 hx
34
- obtain ⟨hy, second⟩ := (mem_relationFiber _ _ _ _).1 hy
35
- exact ⟨ZFSet.pair_mem_prod.2 ⟨hi, hv⟩, i, hi, v, hv, x, hx, y, hy, rfl, equal, first, second⟩
36
-
37
- theorem pair_mem_indexedSubmeetGraph (I B μ domains i v : ZFSet.{u}) :
38
- ZFSet.pair i v ∈ indexedSubmeetGraph I B μ domains ↔
39
- i ∈ I ∧ v ∈ μ ∧ ∃ x ∈ relationFiber B domains i, ∃ y ∈ relationFiber B domains i,
40
- ∃ w ∈ relationFiber B domains i, v = ZFSet.pair (ZFSet.pair x y) w := by
41
- rw [indexedSubmeetGraph, ZFSet.mem_sep]
42
- constructor
43
- · rintro ⟨_, j, hj, v', hv, x, hx, y, hy, w, hw, equal, value, first, second, third⟩
44
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
45
- exact ⟨hj, hv, x, (mem_relationFiber _ _ _ _).2 ⟨hx, first⟩,
46
- y, (mem_relationFiber _ _ _ _).2 ⟨hy, second⟩,
47
- w, (mem_relationFiber _ _ _ _).2 ⟨hw, third⟩, value⟩
48
- · rintro ⟨hi, hv, x, hx, y, hy, w, hw, equal⟩
49
- obtain ⟨hx, first⟩ := (mem_relationFiber _ _ _ _).1 hx
50
- obtain ⟨hy, second⟩ := (mem_relationFiber _ _ _ _).1 hy
51
- obtain ⟨hw, third⟩ := (mem_relationFiber _ _ _ _).1 hw
52
- exact ⟨ZFSet.pair_mem_prod.2 ⟨hi, hv⟩, i, hi, v, hv, x, hx, y, hy,
53
- w, hw, rfl, equal, first, second, third⟩
54
-
55
- theorem suborderFiber_pair_iff {I B R domains i x y : ZFSet.{u}} (hi : i ∈ I) :
56
- ZFSet.pair x y ∈ relationFiber R (indexedSuborderGraph I B R domains) i ↔
57
- ZFSet.pair x y ∈ R ∧ x ∈ relationFiber B domains i ∧ y ∈ relationFiber B domains i := by
58
- rw [mem_relationFiber, pair_mem_indexedSuborderGraph]
59
- constructor
60
- · rintro ⟨hxy, _, _, a, ha, b, hb, equal⟩
61
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
62
- exact ⟨hxy, ha, hb⟩
63
- · rintro ⟨hxy, hx, hy⟩
64
- exact ⟨hxy, hi, hxy, x, hx, y, hy, rfl⟩
65
-
66
- theorem submeetFiber_triple_iff {I B μ domains i x y w : ZFSet.{u}} (hi : i ∈ I) :
67
- ZFSet.pair (ZFSet.pair x y) w ∈ relationFiber μ (indexedSubmeetGraph I B μ domains) i ↔
68
- ZFSet.pair (ZFSet.pair x y) w ∈ μ ∧ x ∈ relationFiber B domains i ∧
69
- y ∈ relationFiber B domains i ∧ w ∈ relationFiber B domains i := by
70
- rw [mem_relationFiber, pair_mem_indexedSubmeetGraph]
71
- constructor
72
- · rintro ⟨hxy, _, _, a, ha, b, hb, c, hc, equal⟩
73
- obtain ⟨ab, rfl⟩ := ZFSet.pair_inj.1 equal
74
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 ab
75
- exact ⟨hxy, ha, hb, hc⟩
76
- · rintro ⟨hxy, hx, hy, hw⟩
77
- exact ⟨hxy, hi, hxy, x, hx, y, hy, w, hw, rfl⟩
78
-
79
- namespace BoundedFormula
80
- def indexedSuborderEntryFormula {n} (z I B R domains : Fin n) : BoundedFormula n :=
81
- exMem I (exMem R.succ (exMem B.succ.succ (exMem B.succ.succ.succ
82
- (.conj (orderedPairFormula z.succ.succ.succ.succ 3 2)
83
- (.conj (orderedPairFormula 2 1 0)
84
- (.conj (pairMembershipFormula 3 1 domains.succ.succ.succ.succ)
85
- (pairMembershipFormula 3 0 domains.succ.succ.succ.succ)))))))
86
-
87
- def indexedSubmeetEntryFormula {n} (z I B μ domains : Fin n) : BoundedFormula n :=
88
- exMem I (exMem μ.succ (exMem B.succ.succ (exMem B.succ.succ.succ (exMem B.succ.succ.succ.succ
89
- (.conj (orderedPairFormula z.succ.succ.succ.succ.succ 4 3)
90
- (.conj (orderedTripleFormula 3 2 1 0)
91
- (.conj (pairMembershipFormula 4 2 domains.succ.succ.succ.succ.succ)
92
- (.conj (pairMembershipFormula 4 1 domains.succ.succ.succ.succ.succ)
93
- (pairMembershipFormula 4 0 domains.succ.succ.succ.succ.succ)))))))))
94
-
95
- theorem truth_indexedSuborderEntryFormula {n} (z I B R domains : Fin n) (env : Fin n → ZFSet.{u}) :
96
- Truth (indexedSuborderEntryFormula z I B R domains) env ↔
97
- env z ∈ indexedSuborderGraph (env I) (env B) (env R) (env domains) := by
98
- simp only [indexedSuborderEntryFormula, truth_exMem, Truth,
99
- truth_orderedPairFormula, truth_pairMembershipFormula, indexedSuborderGraph, ZFSet.mem_sep]
100
- refine ⟨fun h => ⟨?_, h⟩, And.right⟩
101
- obtain ⟨i, hi, v, hv, _, _, _, _, equal, _⟩ := h
102
- change env z = ZFSet.pair i v at equal
103
- rw [equal]
104
- exact ZFSet.pair_mem_prod.2 ⟨hi, hv⟩
105
-
106
- theorem truth_indexedSubmeetEntryFormula {n} (z I B μ domains : Fin n) (env : Fin n → ZFSet.{u}) :
107
- Truth (indexedSubmeetEntryFormula z I B μ domains) env ↔
108
- env z ∈ indexedSubmeetGraph (env I) (env B) (env μ) (env domains) := by
109
- simp only [indexedSubmeetEntryFormula, truth_exMem, Truth, truth_orderedPairFormula,
110
- truth_orderedTripleFormula, truth_pairMembershipFormula, indexedSubmeetGraph, ZFSet.mem_sep]
111
- refine ⟨fun h => ⟨?_, h⟩, And.right⟩
112
- obtain ⟨i, hi, v, hv, _, _, _, _, _, _, equal, _⟩ := h
113
- change env z = ZFSet.pair i v at equal
114
- rw [equal]
115
- exact ZFSet.pair_mem_prod.2 ⟨hi, hv⟩
116
- end BoundedFormula
117
-
118
- end PartitionPilot.Forcing
119
-
120
- end
121
-
122
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Geometry.SeparationTileCodes
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+ open SetFormula
9
+ universe u
10
+
11
+ def indexedSuborderGraph (I B R domains : ZFSet.{u}) : ZFSet.{u} :=
12
+ ZFSet.sep (fun z => ∃ i ∈ I, ∃ v ∈ R, ∃ x ∈ B, ∃ y ∈ B,
13
+ z = ZFSet.pair i v ∧ v = ZFSet.pair x y ∧
14
+ ZFSet.pair i x ∈ domains ∧ ZFSet.pair i y ∈ domains) (ZFSet.prod I R)
15
+
16
+ def indexedSubmeetGraph (I B μ domains : ZFSet.{u}) : ZFSet.{u} :=
17
+ ZFSet.sep (fun z => ∃ i ∈ I, ∃ v ∈ μ, ∃ x ∈ B, ∃ y ∈ B, ∃ w ∈ B,
18
+ z = ZFSet.pair i v ∧ v = ZFSet.pair (ZFSet.pair x y) w ∧
19
+ ZFSet.pair i x ∈ domains ∧ ZFSet.pair i y ∈ domains ∧ ZFSet.pair i w ∈ domains)
20
+ (ZFSet.prod I μ)
21
+
22
+ theorem pair_mem_indexedSuborderGraph (I B R domains i v : ZFSet.{u}) :
23
+ ZFSet.pair i v ∈ indexedSuborderGraph I B R domains ↔
24
+ i ∈ I ∧ v ∈ R ∧ ∃ x ∈ relationFiber B domains i, ∃ y ∈ relationFiber B domains i,
25
+ v = ZFSet.pair x y := by
26
+ rw [indexedSuborderGraph, ZFSet.mem_sep]
27
+ constructor
28
+ · rintro ⟨_, j, hj, w, hw, x, hx, y, hy, equal, value, first, second⟩
29
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
30
+ exact ⟨hj, hw, x, (mem_relationFiber _ _ _ _).2 ⟨hx, first⟩,
31
+ y, (mem_relationFiber _ _ _ _).2 ⟨hy, second⟩, value⟩
32
+ · rintro ⟨hi, hv, x, hx, y, hy, equal⟩
33
+ obtain ⟨hx, first⟩ := (mem_relationFiber _ _ _ _).1 hx
34
+ obtain ⟨hy, second⟩ := (mem_relationFiber _ _ _ _).1 hy
35
+ exact ⟨ZFSet.pair_mem_prod.2 ⟨hi, hv⟩, i, hi, v, hv, x, hx, y, hy, rfl, equal, first, second⟩
36
+
37
+ theorem pair_mem_indexedSubmeetGraph (I B μ domains i v : ZFSet.{u}) :
38
+ ZFSet.pair i v ∈ indexedSubmeetGraph I B μ domains ↔
39
+ i ∈ I ∧ v ∈ μ ∧ ∃ x ∈ relationFiber B domains i, ∃ y ∈ relationFiber B domains i,
40
+ ∃ w ∈ relationFiber B domains i, v = ZFSet.pair (ZFSet.pair x y) w := by
41
+ rw [indexedSubmeetGraph, ZFSet.mem_sep]
42
+ constructor
43
+ · rintro ⟨_, j, hj, v', hv, x, hx, y, hy, w, hw, equal, value, first, second, third⟩
44
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
45
+ exact ⟨hj, hv, x, (mem_relationFiber _ _ _ _).2 ⟨hx, first⟩,
46
+ y, (mem_relationFiber _ _ _ _).2 ⟨hy, second⟩,
47
+ w, (mem_relationFiber _ _ _ _).2 ⟨hw, third⟩, value⟩
48
+ · rintro ⟨hi, hv, x, hx, y, hy, w, hw, equal⟩
49
+ obtain ⟨hx, first⟩ := (mem_relationFiber _ _ _ _).1 hx
50
+ obtain ⟨hy, second⟩ := (mem_relationFiber _ _ _ _).1 hy
51
+ obtain ⟨hw, third⟩ := (mem_relationFiber _ _ _ _).1 hw
52
+ exact ⟨ZFSet.pair_mem_prod.2 ⟨hi, hv⟩, i, hi, v, hv, x, hx, y, hy,
53
+ w, hw, rfl, equal, first, second, third⟩
54
+
55
+ theorem suborderFiber_pair_iff {I B R domains i x y : ZFSet.{u}} (hi : i ∈ I) :
56
+ ZFSet.pair x y ∈ relationFiber R (indexedSuborderGraph I B R domains) i ↔
57
+ ZFSet.pair x y ∈ R ∧ x ∈ relationFiber B domains i ∧ y ∈ relationFiber B domains i := by
58
+ rw [mem_relationFiber, pair_mem_indexedSuborderGraph]
59
+ constructor
60
+ · rintro ⟨hxy, _, _, a, ha, b, hb, equal⟩
61
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
62
+ exact ⟨hxy, ha, hb⟩
63
+ · rintro ⟨hxy, hx, hy⟩
64
+ exact ⟨hxy, hi, hxy, x, hx, y, hy, rfl⟩
65
+
66
+ theorem submeetFiber_triple_iff {I B μ domains i x y w : ZFSet.{u}} (hi : i ∈ I) :
67
+ ZFSet.pair (ZFSet.pair x y) w ∈ relationFiber μ (indexedSubmeetGraph I B μ domains) i ↔
68
+ ZFSet.pair (ZFSet.pair x y) w ∈ μ ∧ x ∈ relationFiber B domains i ∧
69
+ y ∈ relationFiber B domains i ∧ w ∈ relationFiber B domains i := by
70
+ rw [mem_relationFiber, pair_mem_indexedSubmeetGraph]
71
+ constructor
72
+ · rintro ⟨hxy, _, _, a, ha, b, hb, c, hc, equal⟩
73
+ obtain ⟨ab, rfl⟩ := ZFSet.pair_inj.1 equal
74
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 ab
75
+ exact ⟨hxy, ha, hb, hc⟩
76
+ · rintro ⟨hxy, hx, hy, hw⟩
77
+ exact ⟨hxy, hi, hxy, x, hx, y, hy, w, hw, rfl⟩
78
+
79
+ namespace BoundedFormula
80
+ def indexedSuborderEntryFormula {n} (z I B R domains : Fin n) : BoundedFormula n :=
81
+ exMem I (exMem R.succ (exMem B.succ.succ (exMem B.succ.succ.succ
82
+ (.conj (orderedPairFormula z.succ.succ.succ.succ 3 2)
83
+ (.conj (orderedPairFormula 2 1 0)
84
+ (.conj (pairMembershipFormula 3 1 domains.succ.succ.succ.succ)
85
+ (pairMembershipFormula 3 0 domains.succ.succ.succ.succ)))))))
86
+
87
+ def indexedSubmeetEntryFormula {n} (z I B μ domains : Fin n) : BoundedFormula n :=
88
+ exMem I (exMem μ.succ (exMem B.succ.succ (exMem B.succ.succ.succ (exMem B.succ.succ.succ.succ
89
+ (.conj (orderedPairFormula z.succ.succ.succ.succ.succ 4 3)
90
+ (.conj (orderedTripleFormula 3 2 1 0)
91
+ (.conj (pairMembershipFormula 4 2 domains.succ.succ.succ.succ.succ)
92
+ (.conj (pairMembershipFormula 4 1 domains.succ.succ.succ.succ.succ)
93
+ (pairMembershipFormula 4 0 domains.succ.succ.succ.succ.succ)))))))))
94
+
95
+ theorem truth_indexedSuborderEntryFormula {n} (z I B R domains : Fin n) (env : Fin n → ZFSet.{u}) :
96
+ Truth (indexedSuborderEntryFormula z I B R domains) env ↔
97
+ env z ∈ indexedSuborderGraph (env I) (env B) (env R) (env domains) := by
98
+ simp only [indexedSuborderEntryFormula, truth_exMem, Truth,
99
+ truth_orderedPairFormula, truth_pairMembershipFormula, indexedSuborderGraph, ZFSet.mem_sep]
100
+ refine ⟨fun h => ⟨?_, h⟩, And.right⟩
101
+ obtain ⟨i, hi, v, hv, _, _, _, _, equal, _⟩ := h
102
+ change env z = ZFSet.pair i v at equal
103
+ rw [equal]
104
+ exact ZFSet.pair_mem_prod.2 ⟨hi, hv⟩
105
+
106
+ theorem truth_indexedSubmeetEntryFormula {n} (z I B μ domains : Fin n) (env : Fin n → ZFSet.{u}) :
107
+ Truth (indexedSubmeetEntryFormula z I B μ domains) env ↔
108
+ env z ∈ indexedSubmeetGraph (env I) (env B) (env μ) (env domains) := by
109
+ simp only [indexedSubmeetEntryFormula, truth_exMem, Truth, truth_orderedPairFormula,
110
+ truth_orderedTripleFormula, truth_pairMembershipFormula, indexedSubmeetGraph, ZFSet.mem_sep]
111
+ refine ⟨fun h => ⟨?_, h⟩, And.right⟩
112
+ obtain ⟨i, hi, v, hv, _, _, _, _, _, _, equal, _⟩ := h
113
+ change env z = ZFSet.pair i v at equal
114
+ rw [equal]
115
+ exact ZFSet.pair_mem_prod.2 ⟨hi, hv⟩
116
+ end BoundedFormula
117
+
118
+ end PartitionPilot.Forcing
119
+
120
+ end
121
+
122
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/IndexedValueLiftCodes.lean CHANGED
@@ -1,60 +1,60 @@
1
- import OAI.SetTheory.PartitionPrinciple.Geometry.GroundEligibleCaps
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
- universe u
9
-
10
- noncomputable def indexedValueLift (T U Q V F J : ZFSet.{u}) : ZFSet.{u} :=
11
- ZFSet.sep (fun z => ∃ i ∈ T, ∃ f ∈ ZFSet.sUnion (ZFSet.sUnion F),
12
- ∃ e ∈ ZFSet.sUnion (ZFSet.sUnion J),
13
- ∃ x ∈ U, ∃ q ∈ Q, ∃ v ∈ V,
14
- z = ZFSet.pair q v ∧ ZFSet.pair i f ∈ F ∧ ZFSet.pair i e ∈ J ∧
15
- ZFSet.pair x q ∈ e ∧ ZFSet.pair x v ∈ f) (ZFSet.prod Q V)
16
-
17
- theorem indexedValueLift_subset (T U Q V F J : ZFSet.{u}) :
18
- indexedValueLift T U Q V F J ⊆ ZFSet.prod Q V := fun _ hz => (ZFSet.mem_sep.1 hz).1
19
-
20
- theorem pair_mem_indexedValueLift (T U Q V F J q v : ZFSet.{u}) :
21
- ZFSet.pair q v ∈ indexedValueLift T U Q V F J ↔
22
- q ∈ Q ∧ v ∈ V ∧ ∃ i ∈ T, ∃ f e, ∃ x ∈ U,
23
- ZFSet.pair i f ∈ F ∧ ZFSet.pair i e ∈ J ∧
24
- ZFSet.pair x q ∈ e ∧ ZFSet.pair x v ∈ f := by
25
- rw [indexedValueLift, ZFSet.mem_sep]
26
- constructor
27
- · rintro ⟨_, i, hi, f, _, e, _, x, hx, p, hp, w, hw, equal, value, inclusion, image, entry⟩
28
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
29
- exact ⟨hp, hw, i, hi, f, e, x, hx, value, inclusion, image, entry⟩
30
- · rintro ⟨hq, hv, i, hi, f, e, x, hx, value, inclusion, image, entry⟩
31
- exact ⟨ZFSet.pair_mem_prod.2 ⟨hq, hv⟩,
32
- i, hi, f, pair_second_mem_doubleUnion value, e, pair_second_mem_doubleUnion inclusion,
33
- x, hx, q, hq, v, hv, rfl, value, inclusion, image, entry⟩
34
-
35
- namespace BoundedFormula
36
- open SetFormula
37
-
38
- def indexedValueLiftEntryFormula : BoundedFormula 9 :=
39
- exMem 1 (exMem 8 (exMem 10 (exMem 5 (exMem 7 (exMem 9
40
- (.conj (orderedPairFormula 6 1 0)
41
- (.conj (pairMembershipFormula 5 4 11)
42
- (.conj (pairMembershipFormula 5 3 12)
43
- (.conj (pairMembershipFormula 2 1 3) (pairMembershipFormula 2 0 4))))))))))
44
-
45
- theorem truth_indexedValueLiftEntryFormula (env : Fin 9 → ZFSet.{u}) :
46
- Truth indexedValueLiftEntryFormula env ↔
47
- ∃ i ∈ env 1, ∃ f ∈ env 7, ∃ e ∈ env 8, ∃ x ∈ env 2, ∃ q ∈ env 3, ∃ v ∈ env 4,
48
- env 0 = ZFSet.pair q v ∧ ZFSet.pair i f ∈ env 5 ∧ ZFSet.pair i e ∈ env 6 ∧
49
- ZFSet.pair x q ∈ e ∧ ZFSet.pair x v ∈ f := by
50
- simp only [indexedValueLiftEntryFormula, truth_exMem, Truth,
51
- truth_orderedPairFormula, truth_pairMembershipFormula]
52
- rfl
53
-
54
- end BoundedFormula
55
-
56
- end PartitionPilot.Forcing
57
-
58
- end
59
-
60
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Geometry.GroundEligibleCaps
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+ universe u
9
+
10
+ noncomputable def indexedValueLift (T U Q V F J : ZFSet.{u}) : ZFSet.{u} :=
11
+ ZFSet.sep (fun z => ∃ i ∈ T, ∃ f ∈ ZFSet.sUnion (ZFSet.sUnion F),
12
+ ∃ e ∈ ZFSet.sUnion (ZFSet.sUnion J),
13
+ ∃ x ∈ U, ∃ q ∈ Q, ∃ v ∈ V,
14
+ z = ZFSet.pair q v ∧ ZFSet.pair i f ∈ F ∧ ZFSet.pair i e ∈ J ∧
15
+ ZFSet.pair x q ∈ e ∧ ZFSet.pair x v ∈ f) (ZFSet.prod Q V)
16
+
17
+ theorem indexedValueLift_subset (T U Q V F J : ZFSet.{u}) :
18
+ indexedValueLift T U Q V F J ⊆ ZFSet.prod Q V := fun _ hz => (ZFSet.mem_sep.1 hz).1
19
+
20
+ theorem pair_mem_indexedValueLift (T U Q V F J q v : ZFSet.{u}) :
21
+ ZFSet.pair q v ∈ indexedValueLift T U Q V F J ↔
22
+ q ∈ Q ∧ v ∈ V ∧ ∃ i ∈ T, ∃ f e, ∃ x ∈ U,
23
+ ZFSet.pair i f ∈ F ∧ ZFSet.pair i e ∈ J ∧
24
+ ZFSet.pair x q ∈ e ∧ ZFSet.pair x v ∈ f := by
25
+ rw [indexedValueLift, ZFSet.mem_sep]
26
+ constructor
27
+ · rintro ⟨_, i, hi, f, _, e, _, x, hx, p, hp, w, hw, equal, value, inclusion, image, entry⟩
28
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
29
+ exact ⟨hp, hw, i, hi, f, e, x, hx, value, inclusion, image, entry⟩
30
+ · rintro ⟨hq, hv, i, hi, f, e, x, hx, value, inclusion, image, entry⟩
31
+ exact ⟨ZFSet.pair_mem_prod.2 ⟨hq, hv⟩,
32
+ i, hi, f, pair_second_mem_doubleUnion value, e, pair_second_mem_doubleUnion inclusion,
33
+ x, hx, q, hq, v, hv, rfl, value, inclusion, image, entry⟩
34
+
35
+ namespace BoundedFormula
36
+ open SetFormula
37
+
38
+ def indexedValueLiftEntryFormula : BoundedFormula 9 :=
39
+ exMem 1 (exMem 8 (exMem 10 (exMem 5 (exMem 7 (exMem 9
40
+ (.conj (orderedPairFormula 6 1 0)
41
+ (.conj (pairMembershipFormula 5 4 11)
42
+ (.conj (pairMembershipFormula 5 3 12)
43
+ (.conj (pairMembershipFormula 2 1 3) (pairMembershipFormula 2 0 4))))))))))
44
+
45
+ theorem truth_indexedValueLiftEntryFormula (env : Fin 9 → ZFSet.{u}) :
46
+ Truth indexedValueLiftEntryFormula env ↔
47
+ ∃ i ∈ env 1, ∃ f ∈ env 7, ∃ e ∈ env 8, ∃ x ∈ env 2, ∃ q ∈ env 3, ∃ v ∈ env 4,
48
+ env 0 = ZFSet.pair q v ∧ ZFSet.pair i f ∈ env 5 ∧ ZFSet.pair i e ∈ env 6 ∧
49
+ ZFSet.pair x q ∈ e ∧ ZFSet.pair x v ∈ f := by
50
+ simp only [indexedValueLiftEntryFormula, truth_exMem, Truth,
51
+ truth_orderedPairFormula, truth_pairMembershipFormula]
52
+ rfl
53
+
54
+ end BoundedFormula
55
+
56
+ end PartitionPilot.Forcing
57
+
58
+ end
59
+
60
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/InitialMainAlgebraCodes.lean CHANGED
@@ -1,202 +1,202 @@
1
- import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageFromCodes
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing.InitialMainAlgebra
8
- universe u
9
-
10
- def carrier : ZFSet.{u} := natSetCode 2
11
- def actors : ZFSet.{u} := natSetCode 1
12
- def bottom : ZFSet.{u} := natSetCode 0
13
- def top : ZFSet.{u} := natSetCode 1
14
- def identity : ZFSet.{u} := bottom
15
- def order : ZFSet.{u} :=
16
- {ZFSet.pair bottom bottom, ZFSet.pair bottom top, ZFSet.pair top top}
17
- def meetGraph : ZFSet.{u} :=
18
- {ZFSet.pair (ZFSet.pair bottom bottom) bottom,
19
- ZFSet.pair (ZFSet.pair bottom top) bottom,
20
- ZFSet.pair (ZFSet.pair top bottom) bottom,
21
- ZFSet.pair (ZFSet.pair top top) top}
22
- def multiplication : ZFSet.{u} := {ZFSet.pair (ZFSet.pair identity identity) identity}
23
- def inverse : ZFSet.{u} := {ZFSet.pair identity identity}
24
- def action : ZFSet.{u} :=
25
- {ZFSet.pair (ZFSet.pair identity bottom) bottom, ZFSet.pair (ZFSet.pair identity top) top}
26
-
27
- theorem bottom_ne_top : (bottom : ZFSet.{u}) ≠ top := by
28
- intro equal
29
- have := natSetCode_injective equal
30
- exact Nat.zero_ne_one this
31
-
32
- theorem mem_carrier (x : ZFSet.{u}) : x ∈ carrier ↔ x = bottom ∨ x = top := by
33
- change x ∈ insert (natSetCode 1) (insert (natSetCode 0) ∅) ↔ _
34
- simp only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false]
35
- exact or_comm
36
-
37
- theorem mem_actors (x : ZFSet.{u}) : x ∈ actors ↔ x = identity := by
38
- change x ∈ insert (natSetCode 0) ∅ ↔ _
39
- simp only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false]
40
- rfl
41
-
42
- theorem bottom_mem : (bottom : ZFSet.{u}) ∈ carrier := (mem_carrier _).2 (Or.inl rfl)
43
- theorem top_mem : (top : ZFSet.{u}) ∈ carrier := (mem_carrier _).2 (Or.inr rfl)
44
- theorem identity_mem : (identity : ZFSet.{u}) ∈ actors := (mem_actors _).2 rfl
45
-
46
- theorem pair_mem_order (x y : ZFSet.{u}) : ZFSet.pair x y ∈ order ↔
47
- (x = bottom ∧ y = bottom) ∨ (x = bottom ∧ y = top) ∨ (x = top ∧ y = top) := by
48
- simp only [order, ZFSet.mem_insert_iff, ZFSet.mem_singleton, ZFSet.pair_inj]
49
-
50
- theorem pair_mem_meetGraph (x y z : ZFSet.{u}) : ZFSet.pair (ZFSet.pair x y) z ∈ meetGraph ↔
51
- ((x = bottom ∧ y = bottom) ∧ z = bottom) ∨
52
- ((x = bottom ∧ y = top) ∧ z = bottom) ∨
53
- ((x = top ∧ y = bottom) ∧ z = bottom) ∨ ((x = top ∧ y = top) ∧ z = top) := by
54
- simp only [meetGraph, ZFSet.mem_insert_iff, ZFSet.mem_singleton, ZFSet.pair_inj]
55
-
56
- theorem pair_mem_multiplication (x y z : ZFSet.{u}) :
57
- ZFSet.pair (ZFSet.pair x y) z ∈ multiplication ↔ (x = identity ∧ y = identity) ∧ z = identity := by
58
- simp only [multiplication, ZFSet.mem_singleton, ZFSet.pair_inj]
59
-
60
- theorem pair_mem_inverse (x y : ZFSet.{u}) : ZFSet.pair x y ∈ inverse ↔ x = identity ∧ y = identity := by
61
- simp only [inverse, ZFSet.mem_singleton, ZFSet.pair_inj]
62
-
63
- theorem pair_mem_action (g x y : ZFSet.{u}) : ZFSet.pair (ZFSet.pair g x) y ∈ action ↔
64
- ((g = identity ∧ x = bottom) ∧ y = bottom) ∨ ((g = identity ∧ x = top) ∧ y = top) := by
65
- simp only [action, ZFSet.mem_pair, ZFSet.pair_inj]
66
-
67
- theorem least (x : ZFSet.{u}) (hx : x ∈ carrier) : ZFSet.pair bottom x ∈ order := by
68
- rcases (mem_carrier x).1 hx with rfl | rfl <;> simp [pair_mem_order]
69
-
70
- theorem greatest (x : ZFSet.{u}) (hx : x ∈ carrier) : ZFSet.pair x top ∈ order := by
71
- rcases (mem_carrier x).1 hx with rfl | rfl <;> simp [pair_mem_order]
72
-
73
- theorem meet_function : ZFSet.IsFunc (ZFSet.prod carrier carrier) carrier (meetGraph : ZFSet.{u}) := by
74
- constructor
75
- · intro z hz
76
- simp only [meetGraph, ZFSet.mem_insert_iff, ZFSet.mem_singleton] at hz
77
- rcases hz with rfl | rfl | rfl | rfl
78
- · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨bottom_mem, bottom_mem⟩, bottom_mem⟩
79
- · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨bottom_mem, top_mem⟩, bottom_mem⟩
80
- · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨top_mem, bottom_mem⟩, bottom_mem⟩
81
- · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨top_mem, top_mem⟩, top_mem⟩
82
- · intro z hz
83
- obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz
84
- rcases (mem_carrier x).1 hx with rfl | rfl <;>
85
- rcases (mem_carrier y).1 hy with rfl | rfl <;>
86
- simp [pair_mem_meetGraph, bottom_ne_top, Ne.symm bottom_ne_top]
87
-
88
- theorem meet_code : MeetOrderCode carrier order (meetGraph : ZFSet.{u}) where
89
- order := {
90
- relation := by
91
- intro z hz
92
- simp only [order, ZFSet.mem_insert_iff, ZFSet.mem_singleton] at hz
93
- rcases hz with rfl | rfl | rfl <;> simp [mem_carrier]
94
- refl := by
95
- intro x hx
96
- rcases (mem_carrier x).1 hx with rfl | rfl <;> simp [pair_mem_order]
97
- antisymm := by
98
- intro x hx y hy xy yx
99
- rcases (mem_carrier x).1 hx with rfl | rfl <;>
100
- rcases (mem_carrier y).1 hy with rfl | rfl <;>
101
- simp_all [pair_mem_order, bottom_ne_top, Ne.symm bottom_ne_top]
102
- trans := by
103
- intro x hx y hy z hz xy yz
104
- rcases (mem_carrier x).1 hx with rfl | rfl <;>
105
- rcases (mem_carrier y).1 hy with rfl | rfl <;>
106
- rcases (mem_carrier z).1 hz with rfl | rfl <;>
107
- simp_all [pair_mem_order, bottom_ne_top, Ne.symm bottom_ne_top] }
108
- operation := meet_function
109
- lower_left := by
110
- intro x y z entry
111
- rcases (pair_mem_meetGraph x y z).1 entry with
112
- ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ <;>
113
- simp [pair_mem_order]
114
- lower_right := by
115
- intro x y z entry
116
- rcases (pair_mem_meetGraph x y z).1 entry with
117
- ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ <;>
118
- simp [pair_mem_order]
119
- greatest := by
120
- intro x y z w hw entry wx wy
121
- rcases (pair_mem_meetGraph x y z).1 entry with
122
- ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ <;>
123
- rcases (mem_carrier w).1 hw with rfl | rfl <;>
124
- simp_all [pair_mem_order, bottom_ne_top, Ne.symm bottom_ne_top]
125
-
126
- theorem group_code : GroupCode actors multiplication inverse (identity : ZFSet.{u}) where
127
- mul_function := by
128
- constructor
129
- · intro z hz
130
- rw [multiplication, ZFSet.mem_singleton] at hz
131
- rw [hz]
132
- simp [mem_actors]
133
- · intro z hz
134
- obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz
135
- obtain rfl := (mem_actors x).1 hx
136
- obtain rfl := (mem_actors y).1 hy
137
- simp [pair_mem_multiplication]
138
- inv_function := by
139
- constructor
140
- · intro z hz
141
- rw [inverse, ZFSet.mem_singleton] at hz
142
- rw [hz]
143
- simp [mem_actors]
144
- · intro x hx
145
- obtain rfl := (mem_actors x).1 hx
146
- simp [pair_mem_inverse]
147
- identity_mem := identity_mem
148
- one_mul := by
149
- intro x hx
150
- obtain rfl := (mem_actors x).1 hx
151
- simp [pair_mem_multiplication]
152
- mul_one := by
153
- intro x hx
154
- obtain rfl := (mem_actors x).1 hx
155
- simp [pair_mem_multiplication]
156
- inv_mul := by
157
- intro x hx y hy entry
158
- obtain rfl := (mem_actors x).1 hx
159
- obtain rfl := (mem_actors y).1 hy
160
- simp [pair_mem_multiplication]
161
- mul_assoc := by
162
- intro x hx y hy z hz a ha b hb c hc xy yz az
163
- obtain rfl := (mem_actors x).1 hx
164
- obtain rfl := (mem_actors y).1 hy
165
- obtain rfl := (mem_actors z).1 hz
166
- obtain rfl := (mem_actors a).1 ha
167
- obtain rfl := (mem_actors b).1 hb
168
- obtain rfl := (mem_actors c).1 hc
169
- simp [pair_mem_multiplication]
170
-
171
- theorem action_code : PosetActionCode actors carrier multiplication identity order (action : ZFSet.{u}) where
172
- function := by
173
- constructor
174
- · intro z hz
175
- simp only [action, ZFSet.mem_pair] at hz
176
- rcases hz with rfl | rfl <;> simp [mem_actors, mem_carrier]
177
- · intro z hz
178
- obtain ⟨g, hg, x, hx, rfl⟩ := ZFSet.mem_prod.1 hz
179
- obtain rfl := (mem_actors g).1 hg
180
- rcases (mem_carrier x).1 hx with rfl | rfl <;>
181
- simp [pair_mem_action, bottom_ne_top, Ne.symm bottom_ne_top]
182
- one := by
183
- intro x hx
184
- rcases (mem_carrier x).1 hx with rfl | rfl <;> simp [pair_mem_action]
185
- mul := by
186
- intro g hg h hh k hk x hx y hy z hz gh hxY gyZ
187
- obtain rfl := (mem_actors g).1 hg
188
- obtain rfl := (mem_actors h).1 hh
189
- obtain rfl := (mem_actors k).1 hk
190
- rcases (pair_mem_action identity x y).1 hxY with ⟨⟨_, rfl⟩, rfl⟩ | ⟨⟨_, rfl⟩, rfl⟩ <;>
191
- simpa only using gyZ
192
- monotone := by
193
- intro g hg x hx y hy z hz w hw gxZ gyW xy
194
- rcases (pair_mem_action g x z).1 gxZ with ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ <;>
195
- rcases (pair_mem_action identity y w).1 gyW with ⟨⟨_, rfl⟩, rfl⟩ | ⟨⟨_, rfl⟩, rfl⟩ <;>
196
- exact xy
197
-
198
- end PartitionPilot.Forcing.InitialMainAlgebra
199
-
200
- end
201
-
202
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageFromCodes
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing.InitialMainAlgebra
8
+ universe u
9
+
10
+ def carrier : ZFSet.{u} := natSetCode 2
11
+ def actors : ZFSet.{u} := natSetCode 1
12
+ def bottom : ZFSet.{u} := natSetCode 0
13
+ def top : ZFSet.{u} := natSetCode 1
14
+ def identity : ZFSet.{u} := bottom
15
+ def order : ZFSet.{u} :=
16
+ {ZFSet.pair bottom bottom, ZFSet.pair bottom top, ZFSet.pair top top}
17
+ def meetGraph : ZFSet.{u} :=
18
+ {ZFSet.pair (ZFSet.pair bottom bottom) bottom,
19
+ ZFSet.pair (ZFSet.pair bottom top) bottom,
20
+ ZFSet.pair (ZFSet.pair top bottom) bottom,
21
+ ZFSet.pair (ZFSet.pair top top) top}
22
+ def multiplication : ZFSet.{u} := {ZFSet.pair (ZFSet.pair identity identity) identity}
23
+ def inverse : ZFSet.{u} := {ZFSet.pair identity identity}
24
+ def action : ZFSet.{u} :=
25
+ {ZFSet.pair (ZFSet.pair identity bottom) bottom, ZFSet.pair (ZFSet.pair identity top) top}
26
+
27
+ theorem bottom_ne_top : (bottom : ZFSet.{u}) ≠ top := by
28
+ intro equal
29
+ have := natSetCode_injective equal
30
+ exact Nat.zero_ne_one this
31
+
32
+ theorem mem_carrier (x : ZFSet.{u}) : x ∈ carrier ↔ x = bottom ∨ x = top := by
33
+ change x ∈ insert (natSetCode 1) (insert (natSetCode 0) ∅) ↔ _
34
+ simp only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false]
35
+ exact or_comm
36
+
37
+ theorem mem_actors (x : ZFSet.{u}) : x ∈ actors ↔ x = identity := by
38
+ change x ∈ insert (natSetCode 0) ∅ ↔ _
39
+ simp only [ZFSet.mem_insert_iff, ZFSet.notMem_empty, or_false]
40
+ rfl
41
+
42
+ theorem bottom_mem : (bottom : ZFSet.{u}) ∈ carrier := (mem_carrier _).2 (Or.inl rfl)
43
+ theorem top_mem : (top : ZFSet.{u}) ∈ carrier := (mem_carrier _).2 (Or.inr rfl)
44
+ theorem identity_mem : (identity : ZFSet.{u}) ∈ actors := (mem_actors _).2 rfl
45
+
46
+ theorem pair_mem_order (x y : ZFSet.{u}) : ZFSet.pair x y ∈ order ↔
47
+ (x = bottom ∧ y = bottom) ∨ (x = bottom ∧ y = top) ∨ (x = top ∧ y = top) := by
48
+ simp only [order, ZFSet.mem_insert_iff, ZFSet.mem_singleton, ZFSet.pair_inj]
49
+
50
+ theorem pair_mem_meetGraph (x y z : ZFSet.{u}) : ZFSet.pair (ZFSet.pair x y) z ∈ meetGraph ↔
51
+ ((x = bottom ∧ y = bottom) ∧ z = bottom) ∨
52
+ ((x = bottom ∧ y = top) ∧ z = bottom) ∨
53
+ ((x = top ∧ y = bottom) ∧ z = bottom) ∨ ((x = top ∧ y = top) ∧ z = top) := by
54
+ simp only [meetGraph, ZFSet.mem_insert_iff, ZFSet.mem_singleton, ZFSet.pair_inj]
55
+
56
+ theorem pair_mem_multiplication (x y z : ZFSet.{u}) :
57
+ ZFSet.pair (ZFSet.pair x y) z ∈ multiplication ↔ (x = identity ∧ y = identity) ∧ z = identity := by
58
+ simp only [multiplication, ZFSet.mem_singleton, ZFSet.pair_inj]
59
+
60
+ theorem pair_mem_inverse (x y : ZFSet.{u}) : ZFSet.pair x y ∈ inverse ↔ x = identity ∧ y = identity := by
61
+ simp only [inverse, ZFSet.mem_singleton, ZFSet.pair_inj]
62
+
63
+ theorem pair_mem_action (g x y : ZFSet.{u}) : ZFSet.pair (ZFSet.pair g x) y ∈ action ↔
64
+ ((g = identity ∧ x = bottom) ∧ y = bottom) ∨ ((g = identity ∧ x = top) ∧ y = top) := by
65
+ simp only [action, ZFSet.mem_pair, ZFSet.pair_inj]
66
+
67
+ theorem least (x : ZFSet.{u}) (hx : x ∈ carrier) : ZFSet.pair bottom x ∈ order := by
68
+ rcases (mem_carrier x).1 hx with rfl | rfl <;> simp [pair_mem_order]
69
+
70
+ theorem greatest (x : ZFSet.{u}) (hx : x ∈ carrier) : ZFSet.pair x top ∈ order := by
71
+ rcases (mem_carrier x).1 hx with rfl | rfl <;> simp [pair_mem_order]
72
+
73
+ theorem meet_function : ZFSet.IsFunc (ZFSet.prod carrier carrier) carrier (meetGraph : ZFSet.{u}) := by
74
+ constructor
75
+ · intro z hz
76
+ simp only [meetGraph, ZFSet.mem_insert_iff, ZFSet.mem_singleton] at hz
77
+ rcases hz with rfl | rfl | rfl | rfl
78
+ · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨bottom_mem, bottom_mem⟩, bottom_mem⟩
79
+ · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨bottom_mem, top_mem⟩, bottom_mem⟩
80
+ · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨top_mem, bottom_mem⟩, bottom_mem⟩
81
+ · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨top_mem, top_mem⟩, top_mem⟩
82
+ · intro z hz
83
+ obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz
84
+ rcases (mem_carrier x).1 hx with rfl | rfl <;>
85
+ rcases (mem_carrier y).1 hy with rfl | rfl <;>
86
+ simp [pair_mem_meetGraph, bottom_ne_top, Ne.symm bottom_ne_top]
87
+
88
+ theorem meet_code : MeetOrderCode carrier order (meetGraph : ZFSet.{u}) where
89
+ order := {
90
+ relation := by
91
+ intro z hz
92
+ simp only [order, ZFSet.mem_insert_iff, ZFSet.mem_singleton] at hz
93
+ rcases hz with rfl | rfl | rfl <;> simp [mem_carrier]
94
+ refl := by
95
+ intro x hx
96
+ rcases (mem_carrier x).1 hx with rfl | rfl <;> simp [pair_mem_order]
97
+ antisymm := by
98
+ intro x hx y hy xy yx
99
+ rcases (mem_carrier x).1 hx with rfl | rfl <;>
100
+ rcases (mem_carrier y).1 hy with rfl | rfl <;>
101
+ simp_all [pair_mem_order, bottom_ne_top, Ne.symm bottom_ne_top]
102
+ trans := by
103
+ intro x hx y hy z hz xy yz
104
+ rcases (mem_carrier x).1 hx with rfl | rfl <;>
105
+ rcases (mem_carrier y).1 hy with rfl | rfl <;>
106
+ rcases (mem_carrier z).1 hz with rfl | rfl <;>
107
+ simp_all [pair_mem_order, bottom_ne_top, Ne.symm bottom_ne_top] }
108
+ operation := meet_function
109
+ lower_left := by
110
+ intro x y z entry
111
+ rcases (pair_mem_meetGraph x y z).1 entry with
112
+ ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ <;>
113
+ simp [pair_mem_order]
114
+ lower_right := by
115
+ intro x y z entry
116
+ rcases (pair_mem_meetGraph x y z).1 entry with
117
+ ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ <;>
118
+ simp [pair_mem_order]
119
+ greatest := by
120
+ intro x y z w hw entry wx wy
121
+ rcases (pair_mem_meetGraph x y z).1 entry with
122
+ ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ <;>
123
+ rcases (mem_carrier w).1 hw with rfl | rfl <;>
124
+ simp_all [pair_mem_order, bottom_ne_top, Ne.symm bottom_ne_top]
125
+
126
+ theorem group_code : GroupCode actors multiplication inverse (identity : ZFSet.{u}) where
127
+ mul_function := by
128
+ constructor
129
+ · intro z hz
130
+ rw [multiplication, ZFSet.mem_singleton] at hz
131
+ rw [hz]
132
+ simp [mem_actors]
133
+ · intro z hz
134
+ obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz
135
+ obtain rfl := (mem_actors x).1 hx
136
+ obtain rfl := (mem_actors y).1 hy
137
+ simp [pair_mem_multiplication]
138
+ inv_function := by
139
+ constructor
140
+ · intro z hz
141
+ rw [inverse, ZFSet.mem_singleton] at hz
142
+ rw [hz]
143
+ simp [mem_actors]
144
+ · intro x hx
145
+ obtain rfl := (mem_actors x).1 hx
146
+ simp [pair_mem_inverse]
147
+ identity_mem := identity_mem
148
+ one_mul := by
149
+ intro x hx
150
+ obtain rfl := (mem_actors x).1 hx
151
+ simp [pair_mem_multiplication]
152
+ mul_one := by
153
+ intro x hx
154
+ obtain rfl := (mem_actors x).1 hx
155
+ simp [pair_mem_multiplication]
156
+ inv_mul := by
157
+ intro x hx y hy entry
158
+ obtain rfl := (mem_actors x).1 hx
159
+ obtain rfl := (mem_actors y).1 hy
160
+ simp [pair_mem_multiplication]
161
+ mul_assoc := by
162
+ intro x hx y hy z hz a ha b hb c hc xy yz az
163
+ obtain rfl := (mem_actors x).1 hx
164
+ obtain rfl := (mem_actors y).1 hy
165
+ obtain rfl := (mem_actors z).1 hz
166
+ obtain rfl := (mem_actors a).1 ha
167
+ obtain rfl := (mem_actors b).1 hb
168
+ obtain rfl := (mem_actors c).1 hc
169
+ simp [pair_mem_multiplication]
170
+
171
+ theorem action_code : PosetActionCode actors carrier multiplication identity order (action : ZFSet.{u}) where
172
+ function := by
173
+ constructor
174
+ · intro z hz
175
+ simp only [action, ZFSet.mem_pair] at hz
176
+ rcases hz with rfl | rfl <;> simp [mem_actors, mem_carrier]
177
+ · intro z hz
178
+ obtain ⟨g, hg, x, hx, rfl⟩ := ZFSet.mem_prod.1 hz
179
+ obtain rfl := (mem_actors g).1 hg
180
+ rcases (mem_carrier x).1 hx with rfl | rfl <;>
181
+ simp [pair_mem_action, bottom_ne_top, Ne.symm bottom_ne_top]
182
+ one := by
183
+ intro x hx
184
+ rcases (mem_carrier x).1 hx with rfl | rfl <;> simp [pair_mem_action]
185
+ mul := by
186
+ intro g hg h hh k hk x hx y hy z hz gh hxY gyZ
187
+ obtain rfl := (mem_actors g).1 hg
188
+ obtain rfl := (mem_actors h).1 hh
189
+ obtain rfl := (mem_actors k).1 hk
190
+ rcases (pair_mem_action identity x y).1 hxY with ⟨⟨_, rfl⟩, rfl⟩ | ⟨⟨_, rfl⟩, rfl⟩ <;>
191
+ simpa only using gyZ
192
+ monotone := by
193
+ intro g hg x hx y hy z hz w hw gxZ gyW xy
194
+ rcases (pair_mem_action g x z).1 gxZ with ⟨⟨rfl, rfl⟩, rfl⟩ | ⟨⟨rfl, rfl⟩, rfl⟩ <;>
195
+ rcases (pair_mem_action identity y w).1 gyW with ⟨⟨_, rfl⟩, rfl⟩ | ⟨⟨_, rfl⟩, rfl⟩ <;>
196
+ exact xy
197
+
198
+ end PartitionPilot.Forcing.InitialMainAlgebra
199
+
200
+ end
201
+
202
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalEmbeddingFormulas.lean CHANGED
@@ -1,67 +1,67 @@
1
- import OAI.SetTheory.PartitionPrinciple.Geometry.IntervalEmbeddingFamilyCodes
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing.BoundedFormula
8
-
9
- open SetFormula
10
- universe u
11
-
12
- def intervalEmbeddingFormula {n} (A D rA rD lo hi f : Fin n) : BoundedFormula n :=
13
- let lift (i : Fin n) : Fin (n + 4) := i.succ.succ.succ.succ
14
- let order : BoundedFormula n :=
15
- .allMem A (.allMem A.succ (.allMem D.succ.succ (.allMem D.succ.succ.succ
16
- (imp (pairMembershipFormula 3 1 (lift f))
17
- (imp (pairMembershipFormula 2 0 (lift f))
18
- (iffFormula (pairMembershipFormula 3 2 (lift rA))
19
- (pairMembershipFormula 1 0 (lift rD))))))))
20
- let inside : BoundedFormula n :=
21
- .allMem A (.allMem D.succ (imp (pairMembershipFormula 1 0 f.succ.succ)
22
- (.conj (pairMembershipFormula lo.succ.succ 0 rD.succ.succ)
23
- (pairMembershipFormula 0 hi.succ.succ rD.succ.succ))))
24
- .conj (injectionFormula A D f) (.conj order inside)
25
-
26
- theorem truth_intervalEmbeddingFormula {n} (A D rA rD lo hi f : Fin n)
27
- (env : Fin n → ZFSet.{u}) :
28
- Truth (intervalEmbeddingFormula A D rA rD lo hi f) env ↔
29
- IntervalEmbeddingCode (env A) (env D) (env rA) (env rD) (env lo) (env hi) (env f) := by
30
- simp only [intervalEmbeddingFormula, Truth, truth_injectionFormula,
31
- truth_imp, truth_pairMembershipFormula, truth_iffFormula]
32
- change (InjectionCode (env A) (env D) (env f) ∧
33
- (∀ a ∈ env A, ∀ b ∈ env A, ∀ q ∈ env D, ∀ z ∈ env D,
34
- ZFSet.pair a q ∈ env f → ZFSet.pair b z ∈ env f →
35
- (ZFSet.pair a b ∈ env rA ↔ ZFSet.pair q z ∈ env rD)) ∧
36
- (∀ a ∈ env A, ∀ q ∈ env D, ZFSet.pair a q ∈ env f →
37
- ZFSet.pair (env lo) q ∈ env rD ∧ ZFSet.pair q (env hi) ∈ env rD)) ↔ _
38
- constructor
39
- · rintro ⟨injection, order, inside⟩
40
- refine ⟨injection, ?_, ?_⟩
41
- · intro a b q z first second
42
- have aq := ZFSet.pair_mem_prod.1 (injection.function.1 first)
43
- have bz := ZFSet.pair_mem_prod.1 (injection.function.1 second)
44
- exact order a aq.1 b bz.1 q aq.2 z bz.2 first second
45
- · intro a q entry
46
- have aq := ZFSet.pair_mem_prod.1 (injection.function.1 entry)
47
- exact inside a aq.1 q aq.2 entry
48
- · intro code
49
- refine ⟨code.injection, ?_, ?_⟩
50
- · intro a _ b _ q _ z _ first second
51
- exact code.order a b q z first second
52
- · intro a _ q _ entry
53
- exact code.inside a q entry
54
-
55
- theorem realize_intervalEmbeddingFormula (M : TransitiveGround.{u}) {n}
56
- (A D rA rD lo hi f : Fin n) (env : Fin n → ZFSet.{u})
57
- (members : ∀ i, env i ∈ M.sets) :
58
- Realize M.sets (intervalEmbeddingFormula A D rA rD lo hi f).toFormula env ↔
59
- IntervalEmbeddingCode (env A) (env D) (env rA) (env rD) (env lo) (env hi) (env f) :=
60
- (realize_toFormula M _ env members).trans
61
- (truth_intervalEmbeddingFormula A D rA rD lo hi f env)
62
-
63
- end PartitionPilot.Forcing.BoundedFormula
64
-
65
- end
66
-
67
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Geometry.IntervalEmbeddingFamilyCodes
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing.BoundedFormula
8
+
9
+ open SetFormula
10
+ universe u
11
+
12
+ def intervalEmbeddingFormula {n} (A D rA rD lo hi f : Fin n) : BoundedFormula n :=
13
+ let lift (i : Fin n) : Fin (n + 4) := i.succ.succ.succ.succ
14
+ let order : BoundedFormula n :=
15
+ .allMem A (.allMem A.succ (.allMem D.succ.succ (.allMem D.succ.succ.succ
16
+ (imp (pairMembershipFormula 3 1 (lift f))
17
+ (imp (pairMembershipFormula 2 0 (lift f))
18
+ (iffFormula (pairMembershipFormula 3 2 (lift rA))
19
+ (pairMembershipFormula 1 0 (lift rD))))))))
20
+ let inside : BoundedFormula n :=
21
+ .allMem A (.allMem D.succ (imp (pairMembershipFormula 1 0 f.succ.succ)
22
+ (.conj (pairMembershipFormula lo.succ.succ 0 rD.succ.succ)
23
+ (pairMembershipFormula 0 hi.succ.succ rD.succ.succ))))
24
+ .conj (injectionFormula A D f) (.conj order inside)
25
+
26
+ theorem truth_intervalEmbeddingFormula {n} (A D rA rD lo hi f : Fin n)
27
+ (env : Fin n → ZFSet.{u}) :
28
+ Truth (intervalEmbeddingFormula A D rA rD lo hi f) env ↔
29
+ IntervalEmbeddingCode (env A) (env D) (env rA) (env rD) (env lo) (env hi) (env f) := by
30
+ simp only [intervalEmbeddingFormula, Truth, truth_injectionFormula,
31
+ truth_imp, truth_pairMembershipFormula, truth_iffFormula]
32
+ change (InjectionCode (env A) (env D) (env f) ∧
33
+ (∀ a ∈ env A, ∀ b ∈ env A, ∀ q ∈ env D, ∀ z ∈ env D,
34
+ ZFSet.pair a q ∈ env f → ZFSet.pair b z ∈ env f →
35
+ (ZFSet.pair a b ∈ env rA ↔ ZFSet.pair q z ∈ env rD)) ∧
36
+ (∀ a ∈ env A, ∀ q ∈ env D, ZFSet.pair a q ∈ env f →
37
+ ZFSet.pair (env lo) q ∈ env rD ∧ ZFSet.pair q (env hi) ∈ env rD)) ↔ _
38
+ constructor
39
+ · rintro ⟨injection, order, inside⟩
40
+ refine ⟨injection, ?_, ?_⟩
41
+ · intro a b q z first second
42
+ have aq := ZFSet.pair_mem_prod.1 (injection.function.1 first)
43
+ have bz := ZFSet.pair_mem_prod.1 (injection.function.1 second)
44
+ exact order a aq.1 b bz.1 q aq.2 z bz.2 first second
45
+ · intro a q entry
46
+ have aq := ZFSet.pair_mem_prod.1 (injection.function.1 entry)
47
+ exact inside a aq.1 q aq.2 entry
48
+ · intro code
49
+ refine ⟨code.injection, ?_, ?_⟩
50
+ · intro a _ b _ q _ z _ first second
51
+ exact code.order a b q z first second
52
+ · intro a _ q _ entry
53
+ exact code.inside a q entry
54
+
55
+ theorem realize_intervalEmbeddingFormula (M : TransitiveGround.{u}) {n}
56
+ (A D rA rD lo hi f : Fin n) (env : Fin n → ZFSet.{u})
57
+ (members : ∀ i, env i ∈ M.sets) :
58
+ Realize M.sets (intervalEmbeddingFormula A D rA rD lo hi f).toFormula env ↔
59
+ IntervalEmbeddingCode (env A) (env D) (env rA) (env rD) (env lo) (env hi) (env f) :=
60
+ (realize_toFormula M _ env members).trans
61
+ (truth_intervalEmbeddingFormula A D rA rD lo hi f env)
62
+
63
+ end PartitionPilot.Forcing.BoundedFormula
64
+
65
+ end
66
+
67
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalHeightFormulas.lean CHANGED
@@ -1,62 +1,62 @@
1
- import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCodedBinaryHeights
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing.BoundedFormula
8
- open SetFormula
9
- universe u
10
-
11
- def intervalHeightFormula {n} (L r D rD lo hi f : Fin n) : BoundedFormula n :=
12
- let lift (i : Fin n) : Fin (n + 4) := i.succ.succ.succ.succ
13
- let strict : BoundedFormula n :=
14
- .allMem L (.allMem L.succ (.allMem D.succ.succ (.allMem D.succ.succ.succ
15
- (imp (.neg (.equal 3 2)) (imp (pairMembershipFormula 3 2 (lift r))
16
- (imp (pairMembershipFormula 3 1 (lift f))
17
- (imp (pairMembershipFormula 2 0 (lift f)) (pairMembershipFormula 1 0 (lift rD)))))))))
18
- let inside : BoundedFormula n :=
19
- .allMem L (.allMem D.succ (imp (pairMembershipFormula 1 0 f.succ.succ)
20
- (.conj (pairMembershipFormula lo.succ.succ 0 rD.succ.succ)
21
- (pairMembershipFormula 0 hi.succ.succ rD.succ.succ))))
22
- .conj (functionFormula L D f) (.conj strict inside)
23
-
24
- theorem truth_intervalHeightFormula {n} (L r D rD lo hi f : Fin n)
25
- (env : Fin n → ZFSet.{u}) :
26
- Truth (intervalHeightFormula L r D rD lo hi f) env ↔
27
- IntervalHeightCode (env L) (env r) (env D) (env rD) (env lo) (env hi) (env f) := by
28
- simp only [intervalHeightFormula, Truth, truth_functionFormula,
29
- truth_imp, truth_pairMembershipFormula]
30
- change (ZFSet.IsFunc (env L) (env D) (env f) ∧
31
- (∀ x ∈ env L, ∀ y ∈ env L, ∀ a ∈ env D, ∀ b ∈ env D,
32
- x ≠ y → ZFSet.pair x y ∈ env r → ZFSet.pair x a ∈ env f →
33
- ZFSet.pair y b ∈ env f → ZFSet.pair a b ∈ env rD) ∧
34
- (∀ x ∈ env L, ∀ a ∈ env D, ZFSet.pair x a ∈ env f →
35
- ZFSet.pair (env lo) a ∈ env rD ∧ ZFSet.pair a (env hi) ∈ env rD)) ↔ _
36
- constructor
37
- · rintro ⟨function, strict, inside⟩
38
- refine ⟨⟨function, ?_⟩, ?_⟩
39
- · intro x hx y hy different lower a b first second
40
- exact strict x hx y hy a (ZFSet.pair_mem_prod.1 (function.1 first)).2
41
- b (ZFSet.pair_mem_prod.1 (function.1 second)).2 different lower first second
42
- · intro x a entry
43
- have bounds := ZFSet.pair_mem_prod.1 (function.1 entry)
44
- exact inside x bounds.1 a bounds.2 entry
45
- · intro code
46
- refine ⟨code.function, ?_, ?_⟩
47
- · intro x hx y hy a _ b _ different lower first second
48
- exact code.strict x hx y hy different lower a b first second
49
- · intro x _ a _ entry
50
- exact code.inside x a entry
51
-
52
- theorem realize_intervalHeightFormula (M : TransitiveGround.{u}) {n}
53
- (L r D rD lo hi f : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) :
54
- Realize M.sets (intervalHeightFormula L r D rD lo hi f).toFormula env ↔
55
- IntervalHeightCode (env L) (env r) (env D) (env rD) (env lo) (env hi) (env f) :=
56
- (realize_toFormula M _ env members).trans (truth_intervalHeightFormula L r D rD lo hi f env)
57
-
58
- end PartitionPilot.Forcing.BoundedFormula
59
-
60
- end
61
-
62
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Geometry.GroundCodedBinaryHeights
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing.BoundedFormula
8
+ open SetFormula
9
+ universe u
10
+
11
+ def intervalHeightFormula {n} (L r D rD lo hi f : Fin n) : BoundedFormula n :=
12
+ let lift (i : Fin n) : Fin (n + 4) := i.succ.succ.succ.succ
13
+ let strict : BoundedFormula n :=
14
+ .allMem L (.allMem L.succ (.allMem D.succ.succ (.allMem D.succ.succ.succ
15
+ (imp (.neg (.equal 3 2)) (imp (pairMembershipFormula 3 2 (lift r))
16
+ (imp (pairMembershipFormula 3 1 (lift f))
17
+ (imp (pairMembershipFormula 2 0 (lift f)) (pairMembershipFormula 1 0 (lift rD)))))))))
18
+ let inside : BoundedFormula n :=
19
+ .allMem L (.allMem D.succ (imp (pairMembershipFormula 1 0 f.succ.succ)
20
+ (.conj (pairMembershipFormula lo.succ.succ 0 rD.succ.succ)
21
+ (pairMembershipFormula 0 hi.succ.succ rD.succ.succ))))
22
+ .conj (functionFormula L D f) (.conj strict inside)
23
+
24
+ theorem truth_intervalHeightFormula {n} (L r D rD lo hi f : Fin n)
25
+ (env : Fin n → ZFSet.{u}) :
26
+ Truth (intervalHeightFormula L r D rD lo hi f) env ↔
27
+ IntervalHeightCode (env L) (env r) (env D) (env rD) (env lo) (env hi) (env f) := by
28
+ simp only [intervalHeightFormula, Truth, truth_functionFormula,
29
+ truth_imp, truth_pairMembershipFormula]
30
+ change (ZFSet.IsFunc (env L) (env D) (env f) ∧
31
+ (∀ x ∈ env L, ∀ y ∈ env L, ∀ a ∈ env D, ∀ b ∈ env D,
32
+ x ≠ y → ZFSet.pair x y ∈ env r → ZFSet.pair x a ∈ env f →
33
+ ZFSet.pair y b ∈ env f → ZFSet.pair a b ∈ env rD) ∧
34
+ (∀ x ∈ env L, ∀ a ∈ env D, ZFSet.pair x a ∈ env f →
35
+ ZFSet.pair (env lo) a ∈ env rD ∧ ZFSet.pair a (env hi) ∈ env rD)) ↔ _
36
+ constructor
37
+ · rintro ⟨function, strict, inside⟩
38
+ refine ⟨⟨function, ?_⟩, ?_⟩
39
+ · intro x hx y hy different lower a b first second
40
+ exact strict x hx y hy a (ZFSet.pair_mem_prod.1 (function.1 first)).2
41
+ b (ZFSet.pair_mem_prod.1 (function.1 second)).2 different lower first second
42
+ · intro x a entry
43
+ have bounds := ZFSet.pair_mem_prod.1 (function.1 entry)
44
+ exact inside x bounds.1 a bounds.2 entry
45
+ · intro code
46
+ refine ⟨code.function, ?_, ?_⟩
47
+ · intro x hx y hy a _ b _ different lower first second
48
+ exact code.strict x hx y hy different lower a b first second
49
+ · intro x _ a _ entry
50
+ exact code.inside x a entry
51
+
52
+ theorem realize_intervalHeightFormula (M : TransitiveGround.{u}) {n}
53
+ (L r D rD lo hi f : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) :
54
+ Realize M.sets (intervalHeightFormula L r D rD lo hi f).toFormula env ↔
55
+ IntervalHeightCode (env L) (env r) (env D) (env rD) (env lo) (env hi) (env f) :=
56
+ (realize_toFormula M _ env members).trans (truth_intervalHeightFormula L r D rD lo hi f env)
57
+
58
+ end PartitionPilot.Forcing.BoundedFormula
59
+
60
+ end
61
+
62
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/IntervalSequenceFormulas.lean CHANGED
@@ -1,277 +1,277 @@
1
- import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIntervalSelection
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
-
9
- universe u
10
-
11
- structure IntervalSequenceCode (N A D rA rD e lo hi t : ZFSet.{u}) : Prop where
12
- function : ZFSet.IsFunc N D t
13
- inside : ∀ i q, ZFSet.pair i q ∈ t → ZFSet.pair lo q ∈ rD ∧ ZFSet.pair q hi ∈ rD
14
- agree : ∀ i j a b q z, ZFSet.pair i a ∈ e → ZFSet.pair j b ∈ e →
15
- ZFSet.pair i q ∈ t → ZFSet.pair j z ∈ t → (a = b ↔ q = z)
16
- order : ∀ i j a b q z, ZFSet.pair i a ∈ e → ZFSet.pair j b ∈ e →
17
- ZFSet.pair i q ∈ t → ZFSet.pair j z ∈ t →
18
- (ZFSet.pair a b ∈ rA ↔ ZFSet.pair q z ∈ rD)
19
-
20
- def intervalNextCandidate (N A D rA rD e lo hi p y : ZFSet.{u}) : Prop :=
21
- y ∈ D ∧ ZFSet.pair lo y ∈ rD ∧ ZFSet.pair y hi ∈ rD ∧
22
- ∀ i ∈ N, ∀ a ∈ A, ∀ b ∈ A, ∀ z ∈ D,
23
- ZFSet.pair i a ∈ e → ZFSet.pair N b ∈ e → ZFSet.pair i z ∈ p →
24
- ((a = b ↔ z = y) ∧ (ZFSet.pair a b ∈ rA ↔ ZFSet.pair z y ∈ rD) ∧
25
- (ZFSet.pair b a ∈ rA ↔ ZFSet.pair y z ∈ rD))
26
-
27
- theorem pair_mem_intervalSequenceInsert (N p y i q : ZFSet.{u}) :
28
- ZFSet.pair i q ∈ insert (ZFSet.pair N y) p ↔
29
- (i = N ∧ q = y) ∨ ZFSet.pair i q ∈ p := by
30
- rw [ZFSet.mem_insert_iff, ZFSet.pair_inj]
31
-
32
- namespace IntervalSequenceCode
33
-
34
- theorem empty (A D rA rD e lo hi : ZFSet.{u}) : IntervalSequenceCode ∅ A D rA rD e lo hi ∅ := by
35
- refine ⟨⟨ZFSet.empty_subset _, fun i hi => False.elim (ZFSet.notMem_empty i hi)⟩, ?_, ?_, ?_⟩
36
- · intro i q h
37
- exact False.elim (ZFSet.notMem_empty _ h)
38
- · intro i j a b q z _ _ h _
39
- exact False.elim (ZFSet.notMem_empty _ h)
40
- · intro i j a b q z _ _ h _
41
- exact False.elim (ZFSet.notMem_empty _ h)
42
-
43
- theorem restrict {N A D rA rD e lo hi t B : ZFSet.{u}}
44
- (code : IntervalSequenceCode N A D rA rD e lo hi t) (subset : B ⊆ N) :
45
- IntervalSequenceCode B A D rA rD e lo hi (graphRestriction B t) := by
46
- have function : FunctionGraphOn N t := ⟨D, code.function⟩
47
- refine ⟨⟨?_, (function.restrict subset).to_isFunc.2⟩, ?_, ?_, ?_⟩
48
- · intro z hz
49
- obtain ⟨i, hi, q, rfl, entry⟩ := mem_graphRestriction.1 hz
50
- exact ZFSet.pair_mem_prod.2 ⟨hi, (ZFSet.pair_mem_prod.1 (code.function.1 entry)).2⟩
51
- · intro i q entry
52
- exact code.inside i q (pair_mem_graphRestriction.1 entry).1
53
- · intro i j a b q z ea eb qi zj
54
- exact code.agree i j a b q z ea eb
55
- (pair_mem_graphRestriction.1 qi).1 (pair_mem_graphRestriction.1 zj).1
56
- · intro i j a b q z ea eb qi zj
57
- exact code.order i j a b q z ea eb
58
- (pair_mem_graphRestriction.1 qi).1 (pair_mem_graphRestriction.1 zj).1
59
-
60
- theorem insert {N A D rA rD e lo hi p y : ZFSet.{u}}
61
- (code : IntervalSequenceCode N A D rA rD e lo hi p)
62
- (enumeration : ZFSet.IsFunc ZFSet.omega A e)
63
- (source : StrictLinearOrderCode A rA) (target : StrictLinearOrderCode D rD)
64
- (candidate : intervalNextCandidate N A D rA rD e lo hi p y) :
65
- IntervalSequenceCode (Insert.insert N N) A D rA rD e lo hi (Insert.insert (ZFSet.pair N y) p) := by
66
- have function : FunctionGraphOn N p := ⟨D, code.function⟩
67
- have enumFunction : FunctionGraphOn ZFSet.omega e := ⟨A, enumeration⟩
68
- have cross (i a b q : ZFSet.{u}) (ea : ZFSet.pair i a ∈ e) (eb : ZFSet.pair N b ∈ e)
69
- (qi : ZFSet.pair i q ∈ p) :
70
- (a = b ↔ q = y) ∧ (ZFSet.pair a b ∈ rA ↔ ZFSet.pair q y ∈ rD) ∧
71
- (ZFSet.pair b a ∈ rA ↔ ZFSet.pair y q ∈ rD) :=
72
- candidate.2.2.2 i (ZFSet.pair_mem_prod.1 (code.function.1 qi)).1
73
- a (ZFSet.pair_mem_prod.1 (enumeration.1 ea)).2
74
- b (ZFSet.pair_mem_prod.1 (enumeration.1 eb)).2
75
- q (ZFSet.pair_mem_prod.1 (code.function.1 qi)).2 ea eb qi
76
- refine ⟨⟨?_, (function.successor y).to_isFunc.2⟩, ?_, ?_, ?_⟩
77
- · intro z hz
78
- rcases ZFSet.mem_insert_iff.1 hz with rfl | hz
79
- · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert _ _, candidate.1⟩
80
- · obtain ⟨i, hi, q, hq, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 hz)
81
- exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert_of_mem _ hi, hq⟩
82
- · intro i q entry
83
- rcases (pair_mem_intervalSequenceInsert N p y i q).1 entry with ⟨rfl, rfl⟩ | entry
84
- · exact ⟨candidate.2.1, candidate.2.2.1⟩
85
- · exact code.inside i q entry
86
- · intro i j a b q z ea eb qi zj
87
- rcases (pair_mem_intervalSequenceInsert N p y i q).1 qi with ⟨hi, hq⟩ | qi
88
- · subst i
89
- subst q
90
- rcases (pair_mem_intervalSequenceInsert N p y j z).1 zj with ⟨hj, hz⟩ | zj
91
- · subst j
92
- subst z
93
- have equal := enumFunction.unique ea eb
94
- exact ⟨fun _ => rfl, fun _ => equal⟩
95
- · have relation := (cross j b a z eb ea zj).1
96
- exact ⟨fun h => (relation.1 h.symm).symm, fun h => (relation.2 h.symm).symm⟩
97
- · rcases (pair_mem_intervalSequenceInsert N p y j z).1 zj with ⟨hj, hz⟩ | zj
98
- · subst j
99
- subst z
100
- exact (cross i a b q ea eb qi).1
101
- · exact code.agree i j a b q z ea eb qi zj
102
- · intro i j a b q z ea eb qi zj
103
- rcases (pair_mem_intervalSequenceInsert N p y i q).1 qi with ⟨hi, hq⟩ | qi
104
- · subst i
105
- subst q
106
- rcases (pair_mem_intervalSequenceInsert N p y j z).1 zj with ⟨hj, hz⟩ | zj
107
- · subst j
108
- subst z
109
- have equal := enumFunction.unique ea eb
110
- subst b
111
- exact iff_of_false (source.irrefl a (ZFSet.pair_mem_prod.1 (enumeration.1 ea)).2)
112
- (target.irrefl y candidate.1)
113
- · exact (cross j b a z eb ea zj).2.2
114
- · rcases (pair_mem_intervalSequenceInsert N p y j z).1 zj with ⟨hj, hz⟩ | zj
115
- · subst j
116
- subst z
117
- exact (cross i a b q ea eb qi).2.1
118
- · exact code.order i j a b q z ea eb qi zj
119
-
120
- end IntervalSequenceCode
121
-
122
- end PartitionPilot.Forcing
123
-
124
-
125
-
126
- namespace PartitionPilot.Forcing
127
-
128
- universe u
129
-
130
- def leastIntervalNextCandidate (N A D rA rD e lo hi p c y : ZFSet.{u}) : Prop :=
131
- intervalNextCandidate N A D rA rD e lo hi p y ∧
132
- ∃ n ∈ ZFSet.omega, ZFSet.pair y n ∈ c ∧
133
- ∀ z ∈ D, intervalNextCandidate N A D rA rD e lo hi p z →
134
- ∀ m ∈ n, ZFSet.pair z m ∉ c
135
-
136
- theorem leastIntervalNextCandidate_unique {N A D rA rD e lo hi p c x y : ZFSet.{u}}
137
- (injection : InjectionCode D ZFSet.omega c)
138
- (hx : leastIntervalNextCandidate N A D rA rD e lo hi p c x)
139
- (hy : leastIntervalNextCandidate N A D rA rD e lo hi p c y) : x = y := by
140
- obtain ⟨xValid, n, hn, xn, leastX⟩ := hx
141
- obtain ⟨yValid, m, hm, ym, leastY⟩ := hy
142
- obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn
143
- obtain ⟨l, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm
144
- rcases lt_trichotomy k l with smaller | equal | larger
145
- · exact False.elim (leastY x xValid.1 xValid (natSetCode k)
146
- ((natSetCode_mem_iff k l).2 smaller) xn)
147
- · subst l
148
- exact injection.injective x y (natSetCode k) xn ym
149
- · exact False.elim (leastX y yValid.1 yValid (natSetCode l)
150
- ((natSetCode_mem_iff l k).2 larger) ym)
151
-
152
- theorem leastIntervalNextCandidate_exists_unique {N A D rA rD e lo hi p c : ZFSet.{u}}
153
- (injection : InjectionCode D ZFSet.omega c)
154
- (candidate : ∃ y, intervalNextCandidate N A D rA rD e lo hi p y) :
155
- ∃! y, leastIntervalNextCandidate N A D rA rD e lo hi p c y := by
156
- classical
157
- let valid : Nat → Prop := fun n => ∃ y, intervalNextCandidate N A D rA rD e lo hi p y ∧
158
- ZFSet.pair y (natSetCode n) ∈ c
159
- have existsValid : ∃ n, valid n := by
160
- obtain ⟨y, hy⟩ := candidate
161
- obtain ⟨a, entry, _⟩ := injection.function.2 y hy.1
162
- have aNat := (ZFSet.pair_mem_prod.1 (injection.function.1 entry)).2
163
- obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode a).1 aNat
164
- exact ⟨n, y, hy, entry⟩
165
- obtain ⟨y, hy, entry⟩ := Nat.find_spec existsValid
166
- have selected : leastIntervalNextCandidate N A D rA rD e lo hi p c y := by
167
- refine ⟨hy, natSetCode (Nat.find existsValid), natSetCode_mem_omega _, entry, ?_⟩
168
- intro z _ hz m hm smaller
169
- obtain ⟨k, lower, equal⟩ := (mem_natSetCode m (Nat.find existsValid)).1 hm
170
- have validK : valid k := ⟨z, hz, equal ▸ smaller⟩
171
- exact Nat.not_lt_of_ge (Nat.find_min' existsValid validK) lower
172
- exact ⟨y, selected, fun z hz => leastIntervalNextCandidate_unique injection hz selected⟩
173
-
174
- namespace BoundedFormula
175
-
176
- open SetFormula
177
-
178
- def iffFormula {n} (φ ψ : BoundedFormula n) : BoundedFormula n :=
179
- .conj (imp φ ψ) (imp ψ φ)
180
-
181
- theorem truth_iffFormula {n} (φ ψ : BoundedFormula n) (env : Fin n → ZFSet.{u}) :
182
- Truth (iffFormula φ ψ) env ↔ (Truth φ env ↔ Truth ψ env) := by
183
- simp only [iffFormula, Truth, truth_imp]
184
- exact ⟨fun h => ⟨h.1, h.2⟩, fun h => ⟨h.mp, h.mpr⟩⟩
185
-
186
- def intervalNextCandidateFormula {n} (N A D rA rD e lo hi p y : Fin n) : BoundedFormula n :=
187
- let lift (i : Fin n) : Fin (n + 4) := i.succ.succ.succ.succ
188
- .conj (.mem y D) (.conj (pairMembershipFormula lo y rD)
189
- (.conj (pairMembershipFormula y hi rD)
190
- (.allMem N (.allMem A.succ (.allMem A.succ.succ (.allMem D.succ.succ.succ
191
- (imp (pairMembershipFormula 3 2 (lift e))
192
- (imp (pairMembershipFormula (lift N) 1 (lift e))
193
- (imp (pairMembershipFormula 3 0 (lift p))
194
- (.conj (iffFormula (.equal 2 1) (.equal 0 (lift y)))
195
- (.conj (iffFormula (pairMembershipFormula 2 1 (lift rA))
196
- (pairMembershipFormula 0 (lift y) (lift rD)))
197
- (iffFormula (pairMembershipFormula 1 2 (lift rA))
198
- (pairMembershipFormula (lift y) 0 (lift rD))))))))))))))
199
-
200
- theorem truth_intervalNextCandidateFormula {n} (N A D rA rD e lo hi p y : Fin n)
201
- (env : Fin n → ZFSet.{u}) :
202
- Truth (intervalNextCandidateFormula N A D rA rD e lo hi p y) env ↔
203
- intervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e)
204
- (env lo) (env hi) (env p) (env y) := by
205
- simp only [intervalNextCandidateFormula, Truth, truth_pairMembershipFormula,
206
- truth_imp, truth_iffFormula]
207
- rfl
208
-
209
- def leastIntervalNextCandidateFormula {n} (N A D rA rD e lo hi p c y omega : Fin n) : BoundedFormula n :=
210
- .conj (intervalNextCandidateFormula N A D rA rD e lo hi p y)
211
- (exMem omega (.conj (pairMembershipFormula y.succ 0 c.succ)
212
- (.allMem D.succ (imp
213
- (intervalNextCandidateFormula N.succ.succ A.succ.succ D.succ.succ rA.succ.succ
214
- rD.succ.succ e.succ.succ lo.succ.succ hi.succ.succ p.succ.succ 0)
215
- (.allMem 1 (.neg (pairMembershipFormula 1 0 c.succ.succ.succ)))))))
216
-
217
- theorem truth_leastIntervalNextCandidateFormula {n} (N A D rA rD e lo hi p c y omega : Fin n)
218
- (env : Fin n → ZFSet.{u}) (hOmega : env omega = ZFSet.omega) :
219
- Truth (leastIntervalNextCandidateFormula N A D rA rD e lo hi p c y omega) env ↔
220
- leastIntervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e)
221
- (env lo) (env hi) (env p) (env c) (env y) := by
222
- simp only [leastIntervalNextCandidateFormula, Truth, truth_exMem, truth_imp,
223
- truth_pairMembershipFormula, truth_intervalNextCandidateFormula]
224
- change (intervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e)
225
- (env lo) (env hi) (env p) (env y) ∧
226
- ∃ k ∈ env omega, ZFSet.pair (env y) k ∈ env c ∧
227
- ∀ z ∈ env D, intervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e)
228
- (env lo) (env hi) (env p) z → ∀ m ∈ k, ZFSet.pair z m ∉ env c) ↔ _
229
- rw [hOmega]
230
- rfl
231
-
232
- theorem realize_leastIntervalNextCandidateFormula (M : TransitiveGround.{u}) {n}
233
- (N A D rA rD e lo hi p c y omega : Fin n) (env : Fin n → ZFSet.{u})
234
- (members : ∀ i, env i ∈ M.sets) (hOmega : env omega = ZFSet.omega) :
235
- Realize M.sets (leastIntervalNextCandidateFormula N A D rA rD e lo hi p c y omega).toFormula env ↔
236
- leastIntervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e)
237
- (env lo) (env hi) (env p) (env c) (env y) :=
238
- (realize_toFormula M _ env members).trans
239
- (truth_leastIntervalNextCandidateFormula N A D rA rD e lo hi p c y omega env hOmega)
240
-
241
- end BoundedFormula
242
-
243
- namespace SetFormula
244
-
245
- def intervalSequenceStepFormula : SetFormula 12 :=
246
- (BoundedFormula.leastIntervalNextCandidateFormula 0 3 4 5 6 7 8 9 1 10 2 11).toFormula
247
-
248
- end SetFormula
249
-
250
- namespace TransitiveGround
251
-
252
- open SetFormula
253
-
254
- theorem realize_intervalSequenceStepFormula (M : TransitiveGround.{u})
255
- (env : Fin 12 → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets)
256
- (hOmega : env 11 = ZFSet.omega) :
257
- Realize M.sets intervalSequenceStepFormula env ↔
258
- leastIntervalNextCandidate (env 0) (env 3) (env 4) (env 5) (env 6) (env 7)
259
- (env 8) (env 9) (env 1) (env 10) (env 2) :=
260
- BoundedFormula.realize_leastIntervalNextCandidateFormula M 0 3 4 5 6 7 8 9 1 10 2 11
261
- env members hOmega
262
-
263
- theorem exists_unique_ground_intervalNext (M : TransitiveGround.{u})
264
- {N A D rA rD e lo hi p c : ZFSet.{u}} (hD : D ∈ M.sets)
265
- (injection : InjectionCode D ZFSet.omega c)
266
- (candidate : ∃ y, intervalNextCandidate N A D rA rD e lo hi p y) :
267
- ∃! y, y ∈ M.sets ∧ leastIntervalNextCandidate N A D rA rD e lo hi p c y := by
268
- obtain ⟨y, selected, unique⟩ := leastIntervalNextCandidate_exists_unique injection candidate
269
- exact ⟨y, ⟨M.transitive hD selected.1.1, selected⟩, fun z hz => unique z hz.2⟩
270
-
271
- end TransitiveGround
272
-
273
- end PartitionPilot.Forcing
274
-
275
- end
276
-
277
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Geometry.GroundIntervalSelection
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+
9
+ universe u
10
+
11
+ structure IntervalSequenceCode (N A D rA rD e lo hi t : ZFSet.{u}) : Prop where
12
+ function : ZFSet.IsFunc N D t
13
+ inside : ∀ i q, ZFSet.pair i q ∈ t → ZFSet.pair lo q ∈ rD ∧ ZFSet.pair q hi ∈ rD
14
+ agree : ∀ i j a b q z, ZFSet.pair i a ∈ e → ZFSet.pair j b ∈ e →
15
+ ZFSet.pair i q ∈ t → ZFSet.pair j z ∈ t → (a = b ↔ q = z)
16
+ order : ∀ i j a b q z, ZFSet.pair i a ∈ e → ZFSet.pair j b ∈ e →
17
+ ZFSet.pair i q ∈ t → ZFSet.pair j z ∈ t →
18
+ (ZFSet.pair a b ∈ rA ↔ ZFSet.pair q z ∈ rD)
19
+
20
+ def intervalNextCandidate (N A D rA rD e lo hi p y : ZFSet.{u}) : Prop :=
21
+ y ∈ D ∧ ZFSet.pair lo y ∈ rD ∧ ZFSet.pair y hi ∈ rD ∧
22
+ ∀ i ∈ N, ∀ a ∈ A, ∀ b ∈ A, ∀ z ∈ D,
23
+ ZFSet.pair i a ∈ e → ZFSet.pair N b ∈ e → ZFSet.pair i z ∈ p →
24
+ ((a = b ↔ z = y) ∧ (ZFSet.pair a b ∈ rA ↔ ZFSet.pair z y ∈ rD) ∧
25
+ (ZFSet.pair b a ∈ rA ↔ ZFSet.pair y z ∈ rD))
26
+
27
+ theorem pair_mem_intervalSequenceInsert (N p y i q : ZFSet.{u}) :
28
+ ZFSet.pair i q ∈ insert (ZFSet.pair N y) p ↔
29
+ (i = N ∧ q = y) ∨ ZFSet.pair i q ∈ p := by
30
+ rw [ZFSet.mem_insert_iff, ZFSet.pair_inj]
31
+
32
+ namespace IntervalSequenceCode
33
+
34
+ theorem empty (A D rA rD e lo hi : ZFSet.{u}) : IntervalSequenceCode ∅ A D rA rD e lo hi ∅ := by
35
+ refine ⟨⟨ZFSet.empty_subset _, fun i hi => False.elim (ZFSet.notMem_empty i hi)⟩, ?_, ?_, ?_⟩
36
+ · intro i q h
37
+ exact False.elim (ZFSet.notMem_empty _ h)
38
+ · intro i j a b q z _ _ h _
39
+ exact False.elim (ZFSet.notMem_empty _ h)
40
+ · intro i j a b q z _ _ h _
41
+ exact False.elim (ZFSet.notMem_empty _ h)
42
+
43
+ theorem restrict {N A D rA rD e lo hi t B : ZFSet.{u}}
44
+ (code : IntervalSequenceCode N A D rA rD e lo hi t) (subset : B ⊆ N) :
45
+ IntervalSequenceCode B A D rA rD e lo hi (graphRestriction B t) := by
46
+ have function : FunctionGraphOn N t := ⟨D, code.function⟩
47
+ refine ⟨⟨?_, (function.restrict subset).to_isFunc.2⟩, ?_, ?_, ?_⟩
48
+ · intro z hz
49
+ obtain ⟨i, hi, q, rfl, entry⟩ := mem_graphRestriction.1 hz
50
+ exact ZFSet.pair_mem_prod.2 ⟨hi, (ZFSet.pair_mem_prod.1 (code.function.1 entry)).2⟩
51
+ · intro i q entry
52
+ exact code.inside i q (pair_mem_graphRestriction.1 entry).1
53
+ · intro i j a b q z ea eb qi zj
54
+ exact code.agree i j a b q z ea eb
55
+ (pair_mem_graphRestriction.1 qi).1 (pair_mem_graphRestriction.1 zj).1
56
+ · intro i j a b q z ea eb qi zj
57
+ exact code.order i j a b q z ea eb
58
+ (pair_mem_graphRestriction.1 qi).1 (pair_mem_graphRestriction.1 zj).1
59
+
60
+ theorem insert {N A D rA rD e lo hi p y : ZFSet.{u}}
61
+ (code : IntervalSequenceCode N A D rA rD e lo hi p)
62
+ (enumeration : ZFSet.IsFunc ZFSet.omega A e)
63
+ (source : StrictLinearOrderCode A rA) (target : StrictLinearOrderCode D rD)
64
+ (candidate : intervalNextCandidate N A D rA rD e lo hi p y) :
65
+ IntervalSequenceCode (Insert.insert N N) A D rA rD e lo hi (Insert.insert (ZFSet.pair N y) p) := by
66
+ have function : FunctionGraphOn N p := ⟨D, code.function⟩
67
+ have enumFunction : FunctionGraphOn ZFSet.omega e := ⟨A, enumeration⟩
68
+ have cross (i a b q : ZFSet.{u}) (ea : ZFSet.pair i a ∈ e) (eb : ZFSet.pair N b ∈ e)
69
+ (qi : ZFSet.pair i q ∈ p) :
70
+ (a = b ↔ q = y) ∧ (ZFSet.pair a b ∈ rA ↔ ZFSet.pair q y ∈ rD) ∧
71
+ (ZFSet.pair b a ∈ rA ↔ ZFSet.pair y q ∈ rD) :=
72
+ candidate.2.2.2 i (ZFSet.pair_mem_prod.1 (code.function.1 qi)).1
73
+ a (ZFSet.pair_mem_prod.1 (enumeration.1 ea)).2
74
+ b (ZFSet.pair_mem_prod.1 (enumeration.1 eb)).2
75
+ q (ZFSet.pair_mem_prod.1 (code.function.1 qi)).2 ea eb qi
76
+ refine ⟨⟨?_, (function.successor y).to_isFunc.2⟩, ?_, ?_, ?_⟩
77
+ · intro z hz
78
+ rcases ZFSet.mem_insert_iff.1 hz with rfl | hz
79
+ · exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert _ _, candidate.1⟩
80
+ · obtain ⟨i, hi, q, hq, rfl⟩ := ZFSet.mem_prod.1 (code.function.1 hz)
81
+ exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_insert_of_mem _ hi, hq⟩
82
+ · intro i q entry
83
+ rcases (pair_mem_intervalSequenceInsert N p y i q).1 entry with ⟨rfl, rfl⟩ | entry
84
+ · exact ⟨candidate.2.1, candidate.2.2.1⟩
85
+ · exact code.inside i q entry
86
+ · intro i j a b q z ea eb qi zj
87
+ rcases (pair_mem_intervalSequenceInsert N p y i q).1 qi with ⟨hi, hq⟩ | qi
88
+ · subst i
89
+ subst q
90
+ rcases (pair_mem_intervalSequenceInsert N p y j z).1 zj with ⟨hj, hz⟩ | zj
91
+ · subst j
92
+ subst z
93
+ have equal := enumFunction.unique ea eb
94
+ exact ⟨fun _ => rfl, fun _ => equal⟩
95
+ · have relation := (cross j b a z eb ea zj).1
96
+ exact ⟨fun h => (relation.1 h.symm).symm, fun h => (relation.2 h.symm).symm⟩
97
+ · rcases (pair_mem_intervalSequenceInsert N p y j z).1 zj with ⟨hj, hz⟩ | zj
98
+ · subst j
99
+ subst z
100
+ exact (cross i a b q ea eb qi).1
101
+ · exact code.agree i j a b q z ea eb qi zj
102
+ · intro i j a b q z ea eb qi zj
103
+ rcases (pair_mem_intervalSequenceInsert N p y i q).1 qi with ⟨hi, hq⟩ | qi
104
+ · subst i
105
+ subst q
106
+ rcases (pair_mem_intervalSequenceInsert N p y j z).1 zj with ⟨hj, hz⟩ | zj
107
+ · subst j
108
+ subst z
109
+ have equal := enumFunction.unique ea eb
110
+ subst b
111
+ exact iff_of_false (source.irrefl a (ZFSet.pair_mem_prod.1 (enumeration.1 ea)).2)
112
+ (target.irrefl y candidate.1)
113
+ · exact (cross j b a z eb ea zj).2.2
114
+ · rcases (pair_mem_intervalSequenceInsert N p y j z).1 zj with ⟨hj, hz⟩ | zj
115
+ · subst j
116
+ subst z
117
+ exact (cross i a b q ea eb qi).2.1
118
+ · exact code.order i j a b q z ea eb qi zj
119
+
120
+ end IntervalSequenceCode
121
+
122
+ end PartitionPilot.Forcing
123
+
124
+
125
+
126
+ namespace PartitionPilot.Forcing
127
+
128
+ universe u
129
+
130
+ def leastIntervalNextCandidate (N A D rA rD e lo hi p c y : ZFSet.{u}) : Prop :=
131
+ intervalNextCandidate N A D rA rD e lo hi p y ∧
132
+ ∃ n ∈ ZFSet.omega, ZFSet.pair y n ∈ c ∧
133
+ ∀ z ∈ D, intervalNextCandidate N A D rA rD e lo hi p z →
134
+ ∀ m ∈ n, ZFSet.pair z m ∉ c
135
+
136
+ theorem leastIntervalNextCandidate_unique {N A D rA rD e lo hi p c x y : ZFSet.{u}}
137
+ (injection : InjectionCode D ZFSet.omega c)
138
+ (hx : leastIntervalNextCandidate N A D rA rD e lo hi p c x)
139
+ (hy : leastIntervalNextCandidate N A D rA rD e lo hi p c y) : x = y := by
140
+ obtain ⟨xValid, n, hn, xn, leastX⟩ := hx
141
+ obtain ⟨yValid, m, hm, ym, leastY⟩ := hy
142
+ obtain ⟨k, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn
143
+ obtain ⟨l, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm
144
+ rcases lt_trichotomy k l with smaller | equal | larger
145
+ · exact False.elim (leastY x xValid.1 xValid (natSetCode k)
146
+ ((natSetCode_mem_iff k l).2 smaller) xn)
147
+ · subst l
148
+ exact injection.injective x y (natSetCode k) xn ym
149
+ · exact False.elim (leastX y yValid.1 yValid (natSetCode l)
150
+ ((natSetCode_mem_iff l k).2 larger) ym)
151
+
152
+ theorem leastIntervalNextCandidate_exists_unique {N A D rA rD e lo hi p c : ZFSet.{u}}
153
+ (injection : InjectionCode D ZFSet.omega c)
154
+ (candidate : ∃ y, intervalNextCandidate N A D rA rD e lo hi p y) :
155
+ ∃! y, leastIntervalNextCandidate N A D rA rD e lo hi p c y := by
156
+ classical
157
+ let valid : Nat → Prop := fun n => ∃ y, intervalNextCandidate N A D rA rD e lo hi p y ∧
158
+ ZFSet.pair y (natSetCode n) ∈ c
159
+ have existsValid : ∃ n, valid n := by
160
+ obtain ⟨y, hy⟩ := candidate
161
+ obtain ⟨a, entry, _⟩ := injection.function.2 y hy.1
162
+ have aNat := (ZFSet.pair_mem_prod.1 (injection.function.1 entry)).2
163
+ obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode a).1 aNat
164
+ exact ⟨n, y, hy, entry⟩
165
+ obtain ⟨y, hy, entry⟩ := Nat.find_spec existsValid
166
+ have selected : leastIntervalNextCandidate N A D rA rD e lo hi p c y := by
167
+ refine ⟨hy, natSetCode (Nat.find existsValid), natSetCode_mem_omega _, entry, ?_⟩
168
+ intro z _ hz m hm smaller
169
+ obtain ⟨k, lower, equal⟩ := (mem_natSetCode m (Nat.find existsValid)).1 hm
170
+ have validK : valid k := ⟨z, hz, equal ▸ smaller⟩
171
+ exact Nat.not_lt_of_ge (Nat.find_min' existsValid validK) lower
172
+ exact ⟨y, selected, fun z hz => leastIntervalNextCandidate_unique injection hz selected⟩
173
+
174
+ namespace BoundedFormula
175
+
176
+ open SetFormula
177
+
178
+ def iffFormula {n} (φ ψ : BoundedFormula n) : BoundedFormula n :=
179
+ .conj (imp φ ψ) (imp ψ φ)
180
+
181
+ theorem truth_iffFormula {n} (φ ψ : BoundedFormula n) (env : Fin n → ZFSet.{u}) :
182
+ Truth (iffFormula φ ψ) env ↔ (Truth φ env ↔ Truth ψ env) := by
183
+ simp only [iffFormula, Truth, truth_imp]
184
+ exact ⟨fun h => ⟨h.1, h.2⟩, fun h => ⟨h.mp, h.mpr⟩⟩
185
+
186
+ def intervalNextCandidateFormula {n} (N A D rA rD e lo hi p y : Fin n) : BoundedFormula n :=
187
+ let lift (i : Fin n) : Fin (n + 4) := i.succ.succ.succ.succ
188
+ .conj (.mem y D) (.conj (pairMembershipFormula lo y rD)
189
+ (.conj (pairMembershipFormula y hi rD)
190
+ (.allMem N (.allMem A.succ (.allMem A.succ.succ (.allMem D.succ.succ.succ
191
+ (imp (pairMembershipFormula 3 2 (lift e))
192
+ (imp (pairMembershipFormula (lift N) 1 (lift e))
193
+ (imp (pairMembershipFormula 3 0 (lift p))
194
+ (.conj (iffFormula (.equal 2 1) (.equal 0 (lift y)))
195
+ (.conj (iffFormula (pairMembershipFormula 2 1 (lift rA))
196
+ (pairMembershipFormula 0 (lift y) (lift rD)))
197
+ (iffFormula (pairMembershipFormula 1 2 (lift rA))
198
+ (pairMembershipFormula (lift y) 0 (lift rD))))))))))))))
199
+
200
+ theorem truth_intervalNextCandidateFormula {n} (N A D rA rD e lo hi p y : Fin n)
201
+ (env : Fin n → ZFSet.{u}) :
202
+ Truth (intervalNextCandidateFormula N A D rA rD e lo hi p y) env ↔
203
+ intervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e)
204
+ (env lo) (env hi) (env p) (env y) := by
205
+ simp only [intervalNextCandidateFormula, Truth, truth_pairMembershipFormula,
206
+ truth_imp, truth_iffFormula]
207
+ rfl
208
+
209
+ def leastIntervalNextCandidateFormula {n} (N A D rA rD e lo hi p c y omega : Fin n) : BoundedFormula n :=
210
+ .conj (intervalNextCandidateFormula N A D rA rD e lo hi p y)
211
+ (exMem omega (.conj (pairMembershipFormula y.succ 0 c.succ)
212
+ (.allMem D.succ (imp
213
+ (intervalNextCandidateFormula N.succ.succ A.succ.succ D.succ.succ rA.succ.succ
214
+ rD.succ.succ e.succ.succ lo.succ.succ hi.succ.succ p.succ.succ 0)
215
+ (.allMem 1 (.neg (pairMembershipFormula 1 0 c.succ.succ.succ)))))))
216
+
217
+ theorem truth_leastIntervalNextCandidateFormula {n} (N A D rA rD e lo hi p c y omega : Fin n)
218
+ (env : Fin n → ZFSet.{u}) (hOmega : env omega = ZFSet.omega) :
219
+ Truth (leastIntervalNextCandidateFormula N A D rA rD e lo hi p c y omega) env ↔
220
+ leastIntervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e)
221
+ (env lo) (env hi) (env p) (env c) (env y) := by
222
+ simp only [leastIntervalNextCandidateFormula, Truth, truth_exMem, truth_imp,
223
+ truth_pairMembershipFormula, truth_intervalNextCandidateFormula]
224
+ change (intervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e)
225
+ (env lo) (env hi) (env p) (env y) ∧
226
+ ∃ k ∈ env omega, ZFSet.pair (env y) k ∈ env c ∧
227
+ ∀ z ∈ env D, intervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e)
228
+ (env lo) (env hi) (env p) z → ∀ m ∈ k, ZFSet.pair z m ∉ env c) ↔ _
229
+ rw [hOmega]
230
+ rfl
231
+
232
+ theorem realize_leastIntervalNextCandidateFormula (M : TransitiveGround.{u}) {n}
233
+ (N A D rA rD e lo hi p c y omega : Fin n) (env : Fin n → ZFSet.{u})
234
+ (members : ∀ i, env i ∈ M.sets) (hOmega : env omega = ZFSet.omega) :
235
+ Realize M.sets (leastIntervalNextCandidateFormula N A D rA rD e lo hi p c y omega).toFormula env ↔
236
+ leastIntervalNextCandidate (env N) (env A) (env D) (env rA) (env rD) (env e)
237
+ (env lo) (env hi) (env p) (env c) (env y) :=
238
+ (realize_toFormula M _ env members).trans
239
+ (truth_leastIntervalNextCandidateFormula N A D rA rD e lo hi p c y omega env hOmega)
240
+
241
+ end BoundedFormula
242
+
243
+ namespace SetFormula
244
+
245
+ def intervalSequenceStepFormula : SetFormula 12 :=
246
+ (BoundedFormula.leastIntervalNextCandidateFormula 0 3 4 5 6 7 8 9 1 10 2 11).toFormula
247
+
248
+ end SetFormula
249
+
250
+ namespace TransitiveGround
251
+
252
+ open SetFormula
253
+
254
+ theorem realize_intervalSequenceStepFormula (M : TransitiveGround.{u})
255
+ (env : Fin 12 → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets)
256
+ (hOmega : env 11 = ZFSet.omega) :
257
+ Realize M.sets intervalSequenceStepFormula env ↔
258
+ leastIntervalNextCandidate (env 0) (env 3) (env 4) (env 5) (env 6) (env 7)
259
+ (env 8) (env 9) (env 1) (env 10) (env 2) :=
260
+ BoundedFormula.realize_leastIntervalNextCandidateFormula M 0 3 4 5 6 7 8 9 1 10 2 11
261
+ env members hOmega
262
+
263
+ theorem exists_unique_ground_intervalNext (M : TransitiveGround.{u})
264
+ {N A D rA rD e lo hi p c : ZFSet.{u}} (hD : D ∈ M.sets)
265
+ (injection : InjectionCode D ZFSet.omega c)
266
+ (candidate : ∃ y, intervalNextCandidate N A D rA rD e lo hi p y) :
267
+ ∃! y, y ∈ M.sets ∧ leastIntervalNextCandidate N A D rA rD e lo hi p c y := by
268
+ obtain ⟨y, selected, unique⟩ := leastIntervalNextCandidate_exists_unique injection candidate
269
+ exact ⟨y, ⟨M.transitive hD selected.1.1, selected⟩, fun z hz => unique z hz.2⟩
270
+
271
+ end TransitiveGround
272
+
273
+ end PartitionPilot.Forcing
274
+
275
+ end
276
+
277
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/LeastSlotOwnerCodes.lean CHANGED
@@ -1,248 +1,248 @@
1
- import OAI.SetTheory.PartitionPrinciple.Geometry.TileStarIncomingCodes
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
- open SetFormula SetRealization
9
- universe u
10
-
11
- def LeastSupportCode (V omega depths supports x v : ZFSet.{u}) : Prop :=
12
- ZFSet.pair v x ∈ supports ∧ ∃ n ∈ omega, ZFSet.pair v n ∈ depths ∧
13
- ∀ w ∈ V, ∀ m ∈ omega, ZFSet.pair w x ∈ supports → ZFSet.pair w m ∈ depths → m ∉ n
14
-
15
- noncomputable def leastSupportGraph (V Q depths supports : ZFSet.{u}) : ZFSet.{u} :=
16
- ZFSet.sep (fun z => ∃ x ∈ Q, ∃ v ∈ V, z = ZFSet.pair x v ∧
17
- LeastSupportCode V ZFSet.omega depths supports x v) (ZFSet.prod Q V)
18
-
19
- theorem pair_mem_leastSupportGraph (V Q depths supports x v : ZFSet.{u}) :
20
- ZFSet.pair x v ∈ leastSupportGraph V Q depths supports ↔
21
- x ∈ Q ∧ v ∈ V ∧ LeastSupportCode V ZFSet.omega depths supports x v := by
22
- rw [leastSupportGraph, ZFSet.mem_sep]
23
- constructor
24
- · rintro ⟨_, x', hx, v', hv, equal, body⟩
25
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
26
- exact ⟨hx, hv, body⟩
27
- · rintro ⟨hx, hv, body⟩
28
- exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hv⟩, x, hx, v, hv, rfl, body⟩
29
-
30
- namespace BoundedFormula
31
- def leastSupportFormula {k} (V omega depths supports x v : Fin k) : BoundedFormula k :=
32
- .conj (pairMembershipFormula v x supports)
33
- (exMem omega (.conj (pairMembershipFormula v.succ 0 depths.succ)
34
- (allMem V.succ (allMem omega.succ.succ
35
- (.imp (pairMembershipFormula 1 x.succ.succ.succ supports.succ.succ.succ)
36
- (.imp (pairMembershipFormula 1 0 depths.succ.succ.succ) (.neg (.mem 0 2))))))))
37
-
38
- theorem truth_leastSupportFormula {k} (V omega depths supports x v : Fin k) (env : Fin k → ZFSet.{u}) :
39
- Truth (leastSupportFormula V omega depths supports x v) env ↔
40
- LeastSupportCode (env V) (env omega) (env depths) (env supports) (env x) (env v) := by
41
- simp only [leastSupportFormula, Truth, truth_exMem, truth_imp, truth_pairMembershipFormula]
42
- rfl
43
-
44
- def leastSupportEntryFormula {k} (z V Q omega depths supports : Fin k) : BoundedFormula k :=
45
- exMem Q (exMem V.succ (.conj (orderedPairFormula z.succ.succ 1 0)
46
- (leastSupportFormula V.succ.succ omega.succ.succ depths.succ.succ supports.succ.succ 1 0)))
47
-
48
- theorem truth_leastSupportEntryFormula {k} (z V Q omega depths supports : Fin k) (env : Fin k → ZFSet.{u}) :
49
- Truth (leastSupportEntryFormula z V Q omega depths supports) env ↔
50
- ∃ x ∈ env Q, ∃ v ∈ env V, env z = ZFSet.pair x v ∧
51
- LeastSupportCode (env V) (env omega) (env depths) (env supports) x v := by
52
- simp only [leastSupportEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, truth_leastSupportFormula]
53
- rfl
54
- end BoundedFormula
55
-
56
- namespace TransitiveGround
57
- theorem leastSupportGraph_mem (M : TransitiveGround.{u})
58
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
59
- (unions : Realize M.sets SetFormula.union Fin.elim0)
60
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
61
- (infinite : Realize M.sets infinity Fin.elim0)
62
- {V Q depths supports : ZFSet.{u}} (hV : V ∈ M.sets) (hQ : Q ∈ M.sets)
63
- (hDepths : depths ∈ M.sets) (hSupports : supports ∈ M.sets) :
64
- leastSupportGraph V Q depths supports ∈ M.sets := by
65
- have hOmega := M.omega_mem separation infinite
66
- let params := extend V (extend Q (extend ZFSet.omega (extend depths (extend supports Fin.elim0))))
67
- have selected := M.bounded_separation_mem separation (BoundedFormula.leastSupportEntryFormula 0 1 2 3 4 5)
68
- params (Fin.cases hV (Fin.cases hQ (Fin.cases hOmega (Fin.cases hDepths
69
- (Fin.cases hSupports (fun i => Fin.elim0 i)))))) (M.prod_mem pairing unions powers separation hQ hV)
70
- have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.leastSupportEntryFormula 0 1 2 3 4 5)
71
- (extend z params)) (ZFSet.prod Q V) = leastSupportGraph V Q depths supports := by
72
- apply ZFSet.ext
73
- intro z
74
- rw [leastSupportGraph, ZFSet.mem_sep, ZFSet.mem_sep]
75
- exact and_congr Iff.rfl (BoundedFormula.truth_leastSupportEntryFormula _ _ _ _ _ _ _)
76
- exact equal ▸ selected
77
- end TransitiveGround
78
-
79
- variable {V X : Type u} (s : Presentation V) (q : Presentation X) (depth : V → Nat)
80
- variable {depths supports : ZFSet.{u}} (supported : V → X → Prop)
81
- variable (depthEntries : ∀ v n, ZFSet.pair (s.encode v) (natSetCode n) ∈ depths ↔ n = depth v)
82
- variable (supportEntries : ∀ v x, ZFSet.pair (s.encode v) (q.encode x) ∈ supports ↔ supported v x)
83
- include depthEntries supportEntries
84
-
85
- theorem leastSupportCode_iff (x : X) (v : V) :
86
- LeastSupportCode s.carrier ZFSet.omega depths supports (q.encode x) (s.encode v) ↔
87
- supported v x ∧ ∀ w, supported w x → depth v ≤ depth w := by
88
- constructor
89
- · rintro ⟨support, n, hn, entry, least⟩
90
- obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn
91
- have equal := (depthEntries v n).1 entry
92
- subst n
93
- refine ⟨(supportEntries v x).1 support, ?_⟩
94
- intro w hw
95
- have noLower := least (s.encode w) (s.encode_mem w) (natSetCode (depth w))
96
- (natSetCode_mem_omega _) ((supportEntries w x).2 hw) ((depthEntries w _).2 rfl)
97
- exact Nat.le_of_not_lt (fun lower => noLower ((natSetCode_mem_iff _ _).2 lower))
98
- · rintro ⟨support, minimal⟩
99
- refine ⟨(supportEntries v x).2 support, natSetCode (depth v), natSetCode_mem_omega _,
100
- (depthEntries v _).2 rfl, ?_⟩
101
- intro w hw m hm member entry lower
102
- obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw
103
- obtain ⟨m, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm
104
- have equal := (depthEntries w m).1 entry
105
- subst m
106
- exact Nat.not_lt_of_ge (minimal w ((supportEntries w x).1 member)) ((natSetCode_mem_iff _ _).1 lower)
107
-
108
- theorem leastSupportGraph_entry (x : X) (v : V) :
109
- ZFSet.pair (q.encode x) (s.encode v) ∈ leastSupportGraph s.carrier q.carrier depths supports ↔
110
- supported v x ∧ ∀ w, supported w x → depth v ≤ depth w := by
111
- rw [pair_mem_leastSupportGraph, leastSupportCode_iff s q depth supported depthEntries supportEntries]
112
- exact ⟨fun h => h.2.2, fun h => ⟨q.encode_mem x, s.encode_mem v, h⟩⟩
113
-
114
- theorem leastSupportGraph_function
115
- (unique : ∀ x, ∃! v, supported v x ∧ ∀ w, supported w x → depth v ≤ depth w) :
116
- ZFSet.IsFunc q.carrier s.carrier (leastSupportGraph s.carrier q.carrier depths supports) := by
117
- refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩
118
- intro x hx
119
- obtain ⟨x, rfl⟩ := (q.mem_carrier x).1 hx
120
- obtain ⟨v, good, only⟩ := unique x
121
- refine ⟨s.encode v, (leastSupportGraph_entry s q depth supported depthEntries supportEntries x v).2 good, ?_⟩
122
- intro w hw
123
- have member := (pair_mem_leastSupportGraph _ _ _ _ _ _).1 hw
124
- obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 member.2.1
125
- exact congrArg s.encode (only w ((leastSupportGraph_entry s q depth supported depthEntries supportEntries x w).1 hw))
126
-
127
- end PartitionPilot.Forcing
128
-
129
-
130
-
131
- namespace PartitionPilot.Forcing
132
- open SetFormula
133
- universe u
134
-
135
- def LeastSlotCode (supports v x j : ZFSet.{u}) : Prop :=
136
- ZFSet.pair (ZFSet.pair v j) x ∈ supports ∧
137
- ∀ k ∈ j, ZFSet.pair (ZFSet.pair v k) x ∉ supports
138
-
139
- theorem LeastSlotCode.le {supports v x j k : ZFSet.{u}}
140
- (code : LeastSlotCode supports v x j) (hj : j ∈ natSetCode 3) (hk : k ∈ natSetCode 3)
141
- (supported : ZFSet.pair (ZFSet.pair v k) x ∈ supports) : j = k ∨ j ∈ k := by
142
- obtain ⟨n, _, rfl⟩ := (mem_natSetCode j 3).1 hj
143
- obtain ⟨m, _, rfl⟩ := (mem_natSetCode k 3).1 hk
144
- rcases Nat.lt_trichotomy n m with less | same | greater
145
- · exact Or.inr ((natSetCode_mem_iff _ _).2 less)
146
- · exact Or.inl (congrArg natSetCode same)
147
- · exact False.elim (code.2 _ ((natSetCode_mem_iff _ _).2 greater) supported)
148
-
149
- theorem LeastSlotCode.unique {supports v x j k : ZFSet.{u}}
150
- (first : LeastSlotCode supports v x j) (second : LeastSlotCode supports v x k)
151
- (hj : j ∈ natSetCode 3) (hk : k ∈ natSetCode 3) : j = k := by
152
- rcases first.le hj hk second.1 with same | less
153
- · exact same
154
- · exact False.elim (second.2 _ less first.1)
155
-
156
- theorem exists_leastSlotCode {supports v x : ZFSet.{u}}
157
- (cover : ∃ j ∈ natSetCode 3, ZFSet.pair (ZFSet.pair v j) x ∈ supports) :
158
- ∃ j ∈ natSetCode 3, LeastSlotCode supports v x j := by
159
- classical
160
- have candidates : ∃ n : Nat, n < 3 ∧ ZFSet.pair (ZFSet.pair v (natSetCode n)) x ∈ supports := by
161
- obtain ⟨j, hj, supported⟩ := cover
162
- obtain ⟨n, hn, rfl⟩ := (mem_natSetCode j 3).1 hj
163
- exact ⟨n, hn, supported⟩
164
- refine ⟨natSetCode (Nat.find candidates), (natSetCode_mem_iff _ _).2 (Nat.find_spec candidates).1,
165
- (Nat.find_spec candidates).2, ?_⟩
166
- intro k hk supported
167
- obtain ⟨k, lower, rfl⟩ := (mem_natSetCode k (Nat.find candidates)).1 hk
168
- exact Nat.find_min candidates lower ⟨Nat.lt_trans lower (Nat.find_spec candidates).1, supported⟩
169
-
170
- noncomputable def leastSlotOwnerGraph (P B V owner supports : ZFSet.{u}) : ZFSet.{u} :=
171
- ZFSet.sep (fun z => ∃ x ∈ B, ∃ j ∈ natSetCode 3, ∃ v ∈ V,
172
- z = ZFSet.pair x j ∧ x ∉ P ∧ ZFSet.pair x v ∈ owner ∧ LeastSlotCode supports v x j)
173
- (ZFSet.prod B (natSetCode 3))
174
-
175
- theorem pair_mem_leastSlotOwnerGraph (P B V owner supports x j : ZFSet.{u}) :
176
- ZFSet.pair x j ∈ leastSlotOwnerGraph P B V owner supports ↔
177
- x ∈ B ∧ j ∈ natSetCode 3 ∧ x ∉ P ∧ ∃ v ∈ V,
178
- ZFSet.pair x v ∈ owner ∧ LeastSlotCode supports v x j := by
179
- rw [leastSlotOwnerGraph, ZFSet.mem_sep]
180
- constructor
181
- · rintro ⟨_, x', hx, j', hj, v, hv, equal, fresh, owned, code⟩
182
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
183
- exact ⟨hx, hj, fresh, v, hv, owned, code⟩
184
- · rintro ⟨hx, hj, fresh, v, hv, owned, code⟩
185
- exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hj⟩, x, hx, j, hj, v, hv, rfl, fresh, owned, code⟩
186
-
187
- theorem pair_mem_leastSlotOwnerGraph_of_owner {P B V owner supports x j v : ZFSet.{u}}
188
- (function : ZFSet.IsFunc B V owner) (owned : ZFSet.pair x v ∈ owner) :
189
- ZFSet.pair x j ∈ leastSlotOwnerGraph P B V owner supports ↔
190
- j ∈ natSetCode 3 ∧ x ∉ P ∧ LeastSlotCode supports v x j := by
191
- have shape := ZFSet.pair_mem_prod.1 (function.1 owned)
192
- rw [pair_mem_leastSlotOwnerGraph]
193
- constructor
194
- · rintro ⟨_, hj, fresh, v', _, owned', code⟩
195
- have equal := (show FunctionGraphOn B owner from ⟨V, function⟩).unique owned' owned
196
- exact ⟨hj, fresh, equal ▸ code⟩
197
- · rintro ⟨hj, fresh, code⟩
198
- exact ⟨shape.1, hj, fresh, v, shape.2, owned, code⟩
199
-
200
- theorem leastSlotOwnerGraph_partial {P B V owner supports : ZFSet.{u}}
201
- (function : ZFSet.IsFunc B V owner) :
202
- PartialFunctionCode B (natSetCode 3) (leastSlotOwnerGraph P B V owner supports) := by
203
- refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩
204
- intro x j k first second
205
- obtain ⟨_, hj, _, v, _, owned, code⟩ := (pair_mem_leastSlotOwnerGraph _ _ _ _ _ _ _).1 first
206
- have other := (pair_mem_leastSlotOwnerGraph_of_owner function owned).1 second
207
- exact code.unique other.2.2 hj other.1
208
-
209
- theorem leastSlotOwnerGraph_function {P B V owner supports : ZFSet.{u}}
210
- (function : ZFSet.IsFunc B V owner)
211
- (cover : ∀ x ∈ B, x ∉ P → ∀ v, ZFSet.pair x v ∈ owner →
212
- ∃ j ∈ natSetCode 3, ZFSet.pair (ZFSet.pair v j) x ∈ supports) :
213
- ZFSet.IsFunc (ZFSet.sep (fun x => x ∉ P) B) (natSetCode 3)
214
- (leastSlotOwnerGraph P B V owner supports) := by
215
- refine ⟨?_, ?_⟩
216
- · intro z hz
217
- have shape := (ZFSet.mem_sep.1 hz).1
218
- obtain ⟨x, hx, j, hj, rfl⟩ := ZFSet.mem_prod.1 shape
219
- have fresh := ((pair_mem_leastSlotOwnerGraph _ _ _ _ _ _ _).1 hz).2.2.1
220
- exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_sep.2 ⟨hx, fresh⟩, hj⟩
221
- · intro x hx
222
- obtain ⟨hx, fresh⟩ := ZFSet.mem_sep.1 hx
223
- obtain ⟨v, owned, _⟩ := function.2 x hx
224
- obtain ⟨j, hj, code⟩ := exists_leastSlotCode (cover x hx fresh v owned)
225
- refine ⟨j, (pair_mem_leastSlotOwnerGraph_of_owner function owned).2 ⟨hj, fresh, code⟩, ?_⟩
226
- intro k other
227
- exact (leastSlotOwnerGraph_partial function).unique x k j other
228
- ((pair_mem_leastSlotOwnerGraph_of_owner function owned).2 ⟨hj, fresh, code⟩)
229
-
230
- theorem leastSlotOwnerGraph_monotone {P B V owner supports order x y j k : ZFSet.{u}}
231
- (first : ZFSet.pair x j ∈ leastSlotOwnerGraph P B V owner supports)
232
- (second : ZFSet.pair y k ∈ leastSlotOwnerGraph P B V owner supports)
233
- (sameOwner : ∀ v w, ZFSet.pair x v ∈ owner → ZFSet.pair y w ∈ owner → v = w)
234
- (ideals : ∀ v ∈ V, ∀ t ∈ natSetCode 3, ∀ a ∈ B, ∀ b ∈ B,
235
- ZFSet.pair a b ∈ order → ZFSet.pair (ZFSet.pair v t) b ∈ supports →
236
- ZFSet.pair (ZFSet.pair v t) a ∈ supports)
237
- (lower : ZFSet.pair x y ∈ order) : j = k ∨ j ∈ k := by
238
- obtain ⟨hx, hj, _, v, hv, owned, code⟩ := (pair_mem_leastSlotOwnerGraph _ _ _ _ _ _ _).1 first
239
- obtain ⟨hy, hk, _, w, _, owned', code'⟩ := (pair_mem_leastSlotOwnerGraph _ _ _ _ _ _ _).1 second
240
- have equal := sameOwner v w owned owned'
241
- subst w
242
- exact code.le hj hk (ideals v hv k hk x hx y hy lower code'.1)
243
-
244
- end PartitionPilot.Forcing
245
-
246
- end
247
-
248
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Geometry.TileStarIncomingCodes
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+ open SetFormula SetRealization
9
+ universe u
10
+
11
+ def LeastSupportCode (V omega depths supports x v : ZFSet.{u}) : Prop :=
12
+ ZFSet.pair v x ∈ supports ∧ ∃ n ∈ omega, ZFSet.pair v n ∈ depths ∧
13
+ ∀ w ∈ V, ∀ m ∈ omega, ZFSet.pair w x ∈ supports → ZFSet.pair w m ∈ depths → m ∉ n
14
+
15
+ noncomputable def leastSupportGraph (V Q depths supports : ZFSet.{u}) : ZFSet.{u} :=
16
+ ZFSet.sep (fun z => ∃ x ∈ Q, ∃ v ∈ V, z = ZFSet.pair x v ∧
17
+ LeastSupportCode V ZFSet.omega depths supports x v) (ZFSet.prod Q V)
18
+
19
+ theorem pair_mem_leastSupportGraph (V Q depths supports x v : ZFSet.{u}) :
20
+ ZFSet.pair x v ∈ leastSupportGraph V Q depths supports ↔
21
+ x ∈ Q ∧ v ∈ V ∧ LeastSupportCode V ZFSet.omega depths supports x v := by
22
+ rw [leastSupportGraph, ZFSet.mem_sep]
23
+ constructor
24
+ · rintro ⟨_, x', hx, v', hv, equal, body⟩
25
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
26
+ exact ⟨hx, hv, body⟩
27
+ · rintro ⟨hx, hv, body⟩
28
+ exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hv⟩, x, hx, v, hv, rfl, body⟩
29
+
30
+ namespace BoundedFormula
31
+ def leastSupportFormula {k} (V omega depths supports x v : Fin k) : BoundedFormula k :=
32
+ .conj (pairMembershipFormula v x supports)
33
+ (exMem omega (.conj (pairMembershipFormula v.succ 0 depths.succ)
34
+ (allMem V.succ (allMem omega.succ.succ
35
+ (.imp (pairMembershipFormula 1 x.succ.succ.succ supports.succ.succ.succ)
36
+ (.imp (pairMembershipFormula 1 0 depths.succ.succ.succ) (.neg (.mem 0 2))))))))
37
+
38
+ theorem truth_leastSupportFormula {k} (V omega depths supports x v : Fin k) (env : Fin k → ZFSet.{u}) :
39
+ Truth (leastSupportFormula V omega depths supports x v) env ↔
40
+ LeastSupportCode (env V) (env omega) (env depths) (env supports) (env x) (env v) := by
41
+ simp only [leastSupportFormula, Truth, truth_exMem, truth_imp, truth_pairMembershipFormula]
42
+ rfl
43
+
44
+ def leastSupportEntryFormula {k} (z V Q omega depths supports : Fin k) : BoundedFormula k :=
45
+ exMem Q (exMem V.succ (.conj (orderedPairFormula z.succ.succ 1 0)
46
+ (leastSupportFormula V.succ.succ omega.succ.succ depths.succ.succ supports.succ.succ 1 0)))
47
+
48
+ theorem truth_leastSupportEntryFormula {k} (z V Q omega depths supports : Fin k) (env : Fin k → ZFSet.{u}) :
49
+ Truth (leastSupportEntryFormula z V Q omega depths supports) env ↔
50
+ ∃ x ∈ env Q, ∃ v ∈ env V, env z = ZFSet.pair x v ∧
51
+ LeastSupportCode (env V) (env omega) (env depths) (env supports) x v := by
52
+ simp only [leastSupportEntryFormula, truth_exMem, Truth, truth_orderedPairFormula, truth_leastSupportFormula]
53
+ rfl
54
+ end BoundedFormula
55
+
56
+ namespace TransitiveGround
57
+ theorem leastSupportGraph_mem (M : TransitiveGround.{u})
58
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
59
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
60
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
61
+ (infinite : Realize M.sets infinity Fin.elim0)
62
+ {V Q depths supports : ZFSet.{u}} (hV : V ∈ M.sets) (hQ : Q ∈ M.sets)
63
+ (hDepths : depths ∈ M.sets) (hSupports : supports ∈ M.sets) :
64
+ leastSupportGraph V Q depths supports ∈ M.sets := by
65
+ have hOmega := M.omega_mem separation infinite
66
+ let params := extend V (extend Q (extend ZFSet.omega (extend depths (extend supports Fin.elim0))))
67
+ have selected := M.bounded_separation_mem separation (BoundedFormula.leastSupportEntryFormula 0 1 2 3 4 5)
68
+ params (Fin.cases hV (Fin.cases hQ (Fin.cases hOmega (Fin.cases hDepths
69
+ (Fin.cases hSupports (fun i => Fin.elim0 i)))))) (M.prod_mem pairing unions powers separation hQ hV)
70
+ have equal : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.leastSupportEntryFormula 0 1 2 3 4 5)
71
+ (extend z params)) (ZFSet.prod Q V) = leastSupportGraph V Q depths supports := by
72
+ apply ZFSet.ext
73
+ intro z
74
+ rw [leastSupportGraph, ZFSet.mem_sep, ZFSet.mem_sep]
75
+ exact and_congr Iff.rfl (BoundedFormula.truth_leastSupportEntryFormula _ _ _ _ _ _ _)
76
+ exact equal ▸ selected
77
+ end TransitiveGround
78
+
79
+ variable {V X : Type u} (s : Presentation V) (q : Presentation X) (depth : V → Nat)
80
+ variable {depths supports : ZFSet.{u}} (supported : V → X → Prop)
81
+ variable (depthEntries : ∀ v n, ZFSet.pair (s.encode v) (natSetCode n) ∈ depths ↔ n = depth v)
82
+ variable (supportEntries : ∀ v x, ZFSet.pair (s.encode v) (q.encode x) ∈ supports ↔ supported v x)
83
+ include depthEntries supportEntries
84
+
85
+ theorem leastSupportCode_iff (x : X) (v : V) :
86
+ LeastSupportCode s.carrier ZFSet.omega depths supports (q.encode x) (s.encode v) ↔
87
+ supported v x ∧ ∀ w, supported w x → depth v ≤ depth w := by
88
+ constructor
89
+ · rintro ⟨support, n, hn, entry, least⟩
90
+ obtain ⟨n, rfl⟩ := (mem_omega_iff_natSetCode n).1 hn
91
+ have equal := (depthEntries v n).1 entry
92
+ subst n
93
+ refine ⟨(supportEntries v x).1 support, ?_⟩
94
+ intro w hw
95
+ have noLower := least (s.encode w) (s.encode_mem w) (natSetCode (depth w))
96
+ (natSetCode_mem_omega _) ((supportEntries w x).2 hw) ((depthEntries w _).2 rfl)
97
+ exact Nat.le_of_not_lt (fun lower => noLower ((natSetCode_mem_iff _ _).2 lower))
98
+ · rintro ⟨support, minimal⟩
99
+ refine ⟨(supportEntries v x).2 support, natSetCode (depth v), natSetCode_mem_omega _,
100
+ (depthEntries v _).2 rfl, ?_⟩
101
+ intro w hw m hm member entry lower
102
+ obtain ⟨w, rfl⟩ := (s.mem_carrier w).1 hw
103
+ obtain ⟨m, rfl⟩ := (mem_omega_iff_natSetCode m).1 hm
104
+ have equal := (depthEntries w m).1 entry
105
+ subst m
106
+ exact Nat.not_lt_of_ge (minimal w ((supportEntries w x).1 member)) ((natSetCode_mem_iff _ _).1 lower)
107
+
108
+ theorem leastSupportGraph_entry (x : X) (v : V) :
109
+ ZFSet.pair (q.encode x) (s.encode v) ∈ leastSupportGraph s.carrier q.carrier depths supports ↔
110
+ supported v x ∧ ∀ w, supported w x → depth v ≤ depth w := by
111
+ rw [pair_mem_leastSupportGraph, leastSupportCode_iff s q depth supported depthEntries supportEntries]
112
+ exact ⟨fun h => h.2.2, fun h => ⟨q.encode_mem x, s.encode_mem v, h⟩⟩
113
+
114
+ theorem leastSupportGraph_function
115
+ (unique : ∀ x, ∃! v, supported v x ∧ ∀ w, supported w x → depth v ≤ depth w) :
116
+ ZFSet.IsFunc q.carrier s.carrier (leastSupportGraph s.carrier q.carrier depths supports) := by
117
+ refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩
118
+ intro x hx
119
+ obtain ⟨x, rfl⟩ := (q.mem_carrier x).1 hx
120
+ obtain ⟨v, good, only⟩ := unique x
121
+ refine ⟨s.encode v, (leastSupportGraph_entry s q depth supported depthEntries supportEntries x v).2 good, ?_⟩
122
+ intro w hw
123
+ have member := (pair_mem_leastSupportGraph _ _ _ _ _ _).1 hw
124
+ obtain ���w, rfl⟩ := (s.mem_carrier w).1 member.2.1
125
+ exact congrArg s.encode (only w ((leastSupportGraph_entry s q depth supported depthEntries supportEntries x w).1 hw))
126
+
127
+ end PartitionPilot.Forcing
128
+
129
+
130
+
131
+ namespace PartitionPilot.Forcing
132
+ open SetFormula
133
+ universe u
134
+
135
+ def LeastSlotCode (supports v x j : ZFSet.{u}) : Prop :=
136
+ ZFSet.pair (ZFSet.pair v j) x ∈ supports ∧
137
+ ∀ k ∈ j, ZFSet.pair (ZFSet.pair v k) x ∉ supports
138
+
139
+ theorem LeastSlotCode.le {supports v x j k : ZFSet.{u}}
140
+ (code : LeastSlotCode supports v x j) (hj : j ∈ natSetCode 3) (hk : k ∈ natSetCode 3)
141
+ (supported : ZFSet.pair (ZFSet.pair v k) x ∈ supports) : j = k ∨ j ∈ k := by
142
+ obtain ⟨n, _, rfl⟩ := (mem_natSetCode j 3).1 hj
143
+ obtain ⟨m, _, rfl⟩ := (mem_natSetCode k 3).1 hk
144
+ rcases Nat.lt_trichotomy n m with less | same | greater
145
+ · exact Or.inr ((natSetCode_mem_iff _ _).2 less)
146
+ · exact Or.inl (congrArg natSetCode same)
147
+ · exact False.elim (code.2 _ ((natSetCode_mem_iff _ _).2 greater) supported)
148
+
149
+ theorem LeastSlotCode.unique {supports v x j k : ZFSet.{u}}
150
+ (first : LeastSlotCode supports v x j) (second : LeastSlotCode supports v x k)
151
+ (hj : j ∈ natSetCode 3) (hk : k ∈ natSetCode 3) : j = k := by
152
+ rcases first.le hj hk second.1 with same | less
153
+ · exact same
154
+ · exact False.elim (second.2 _ less first.1)
155
+
156
+ theorem exists_leastSlotCode {supports v x : ZFSet.{u}}
157
+ (cover : ∃ j ∈ natSetCode 3, ZFSet.pair (ZFSet.pair v j) x ∈ supports) :
158
+ ∃ j ∈ natSetCode 3, LeastSlotCode supports v x j := by
159
+ classical
160
+ have candidates : ∃ n : Nat, n < 3 ∧ ZFSet.pair (ZFSet.pair v (natSetCode n)) x ∈ supports := by
161
+ obtain ⟨j, hj, supported⟩ := cover
162
+ obtain ⟨n, hn, rfl⟩ := (mem_natSetCode j 3).1 hj
163
+ exact ⟨n, hn, supported⟩
164
+ refine ⟨natSetCode (Nat.find candidates), (natSetCode_mem_iff _ _).2 (Nat.find_spec candidates).1,
165
+ (Nat.find_spec candidates).2, ?_⟩
166
+ intro k hk supported
167
+ obtain ⟨k, lower, rfl⟩ := (mem_natSetCode k (Nat.find candidates)).1 hk
168
+ exact Nat.find_min candidates lower ⟨Nat.lt_trans lower (Nat.find_spec candidates).1, supported⟩
169
+
170
+ noncomputable def leastSlotOwnerGraph (P B V owner supports : ZFSet.{u}) : ZFSet.{u} :=
171
+ ZFSet.sep (fun z => ∃ x ∈ B, ∃ j ∈ natSetCode 3, ∃ v ∈ V,
172
+ z = ZFSet.pair x j ∧ x ∉ P ∧ ZFSet.pair x v ∈ owner ∧ LeastSlotCode supports v x j)
173
+ (ZFSet.prod B (natSetCode 3))
174
+
175
+ theorem pair_mem_leastSlotOwnerGraph (P B V owner supports x j : ZFSet.{u}) :
176
+ ZFSet.pair x j ∈ leastSlotOwnerGraph P B V owner supports ↔
177
+ x ∈ B ∧ j ∈ natSetCode 3 ∧ x ∉ P ∧ ∃ v ∈ V,
178
+ ZFSet.pair x v ∈ owner ∧ LeastSlotCode supports v x j := by
179
+ rw [leastSlotOwnerGraph, ZFSet.mem_sep]
180
+ constructor
181
+ · rintro ⟨_, x', hx, j', hj, v, hv, equal, fresh, owned, code⟩
182
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
183
+ exact ⟨hx, hj, fresh, v, hv, owned, code⟩
184
+ · rintro ⟨hx, hj, fresh, v, hv, owned, code⟩
185
+ exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hj⟩, x, hx, j, hj, v, hv, rfl, fresh, owned, code⟩
186
+
187
+ theorem pair_mem_leastSlotOwnerGraph_of_owner {P B V owner supports x j v : ZFSet.{u}}
188
+ (function : ZFSet.IsFunc B V owner) (owned : ZFSet.pair x v ∈ owner) :
189
+ ZFSet.pair x j ∈ leastSlotOwnerGraph P B V owner supports ↔
190
+ j ∈ natSetCode 3 ∧ x ∉ P ∧ LeastSlotCode supports v x j := by
191
+ have shape := ZFSet.pair_mem_prod.1 (function.1 owned)
192
+ rw [pair_mem_leastSlotOwnerGraph]
193
+ constructor
194
+ · rintro ⟨_, hj, fresh, v', _, owned', code⟩
195
+ have equal := (show FunctionGraphOn B owner from ⟨V, function⟩).unique owned' owned
196
+ exact ⟨hj, fresh, equal ▸ code⟩
197
+ · rintro ⟨hj, fresh, code⟩
198
+ exact ⟨shape.1, hj, fresh, v, shape.2, owned, code⟩
199
+
200
+ theorem leastSlotOwnerGraph_partial {P B V owner supports : ZFSet.{u}}
201
+ (function : ZFSet.IsFunc B V owner) :
202
+ PartialFunctionCode B (natSetCode 3) (leastSlotOwnerGraph P B V owner supports) := by
203
+ refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩
204
+ intro x j k first second
205
+ obtain ⟨_, hj, _, v, _, owned, code⟩ := (pair_mem_leastSlotOwnerGraph _ _ _ _ _ _ _).1 first
206
+ have other := (pair_mem_leastSlotOwnerGraph_of_owner function owned).1 second
207
+ exact code.unique other.2.2 hj other.1
208
+
209
+ theorem leastSlotOwnerGraph_function {P B V owner supports : ZFSet.{u}}
210
+ (function : ZFSet.IsFunc B V owner)
211
+ (cover : ∀ x ∈ B, x ∉ P → ∀ v, ZFSet.pair x v ∈ owner →
212
+ ∃ j ∈ natSetCode 3, ZFSet.pair (ZFSet.pair v j) x ∈ supports) :
213
+ ZFSet.IsFunc (ZFSet.sep (fun x => x ∉ P) B) (natSetCode 3)
214
+ (leastSlotOwnerGraph P B V owner supports) := by
215
+ refine ⟨?_, ?_⟩
216
+ · intro z hz
217
+ have shape := (ZFSet.mem_sep.1 hz).1
218
+ obtain ⟨x, hx, j, hj, rfl⟩ := ZFSet.mem_prod.1 shape
219
+ have fresh := ((pair_mem_leastSlotOwnerGraph _ _ _ _ _ _ _).1 hz).2.2.1
220
+ exact ZFSet.pair_mem_prod.2 ⟨ZFSet.mem_sep.2 ⟨hx, fresh⟩, hj⟩
221
+ · intro x hx
222
+ obtain ⟨hx, fresh⟩ := ZFSet.mem_sep.1 hx
223
+ obtain ⟨v, owned, _⟩ := function.2 x hx
224
+ obtain ⟨j, hj, code⟩ := exists_leastSlotCode (cover x hx fresh v owned)
225
+ refine ⟨j, (pair_mem_leastSlotOwnerGraph_of_owner function owned).2 ⟨hj, fresh, code⟩, ?_⟩
226
+ intro k other
227
+ exact (leastSlotOwnerGraph_partial function).unique x k j other
228
+ ((pair_mem_leastSlotOwnerGraph_of_owner function owned).2 ⟨hj, fresh, code⟩)
229
+
230
+ theorem leastSlotOwnerGraph_monotone {P B V owner supports order x y j k : ZFSet.{u}}
231
+ (first : ZFSet.pair x j ∈ leastSlotOwnerGraph P B V owner supports)
232
+ (second : ZFSet.pair y k ∈ leastSlotOwnerGraph P B V owner supports)
233
+ (sameOwner : ∀ v w, ZFSet.pair x v ∈ owner → ZFSet.pair y w ∈ owner → v = w)
234
+ (ideals : ∀ v ∈ V, ∀ t ∈ natSetCode 3, ∀ a ∈ B, ∀ b ∈ B,
235
+ ZFSet.pair a b ∈ order → ZFSet.pair (ZFSet.pair v t) b ∈ supports →
236
+ ZFSet.pair (ZFSet.pair v t) a ∈ supports)
237
+ (lower : ZFSet.pair x y ∈ order) : j = k ∨ j ∈ k := by
238
+ obtain ⟨hx, hj, _, v, hv, owned, code⟩ := (pair_mem_leastSlotOwnerGraph _ _ _ _ _ _ _).1 first
239
+ obtain ⟨hy, hk, _, w, _, owned', code'⟩ := (pair_mem_leastSlotOwnerGraph _ _ _ _ _ _ _).1 second
240
+ have equal := sameOwner v w owned owned'
241
+ subst w
242
+ exact code.le hj hk (ideals v hv k hk x hx y hy lower code'.1)
243
+
244
+ end PartitionPilot.Forcing
245
+
246
+ end
247
+
248
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/LiftedCompressionFormulas.lean CHANGED
@@ -1,118 +1,118 @@
1
- import OAI.SetTheory.PartitionPrinciple.Geometry.LiftedCompressionFunctions
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing.BoundedFormula
8
-
9
- open SetFormula
10
- universe u
11
-
12
- def rightTripleFormula {n} (z a b c : Fin n) : BoundedFormula n :=
13
- exMem z (exMem 0 (.conj (orderedPairFormula 0 b.succ.succ c.succ.succ)
14
- (orderedPairFormula z.succ.succ a.succ.succ 0)))
15
-
16
- theorem truth_rightTripleFormula {n} (z a b c : Fin n) (env : Fin n → ZFSet.{u}) :
17
- Truth (rightTripleFormula z a b c) env ↔
18
- env z = ZFSet.pair (env a) (ZFSet.pair (env b) (env c)) := by
19
- simp only [rightTripleFormula, truth_exMem, Truth, truth_orderedPairFormula]
20
- change (∃ s ∈ env z, ∃ t ∈ s, t = ZFSet.pair (env b) (env c) ∧
21
- env z = ZFSet.pair (env a) t) ↔ _
22
- constructor
23
- · rintro ⟨_, _, _, _, rfl, equal⟩
24
- exact equal
25
- · intro equal
26
- refine ⟨{env a, ZFSet.pair (env b) (env c)}, ?_, ZFSet.pair (env b) (env c),
27
- ZFSet.mem_pair.2 (Or.inr rfl), rfl, equal⟩
28
- rw [equal]
29
- exact ZFSet.mem_pair.2 (Or.inr rfl)
30
-
31
- def taggedPairTripleFormula {n} (z l i j q : Fin n) : BoundedFormula n :=
32
- exMem z (exMem 0 (.conj (orderedTripleFormula 0 i.succ.succ j.succ.succ q.succ.succ)
33
- (orderedPairFormula z.succ.succ l.succ.succ 0)))
34
-
35
- theorem truth_taggedPairTripleFormula {n} (z l i j q : Fin n) (env : Fin n → ZFSet.{u}) :
36
- Truth (taggedPairTripleFormula z l i j q) env ↔
37
- env z = ZFSet.pair (env l) (ZFSet.pair (ZFSet.pair (env i) (env j)) (env q)) := by
38
- simp only [taggedPairTripleFormula, truth_exMem, Truth, truth_orderedTripleFormula,
39
- truth_orderedPairFormula]
40
- change (∃ s ∈ env z, ∃ t ∈ s, t = ZFSet.pair (ZFSet.pair (env i) (env j)) (env q) ∧
41
- env z = ZFSet.pair (env l) t) ↔ _
42
- constructor
43
- · rintro ⟨_, _, _, _, rfl, equal⟩
44
- exact equal
45
- · intro equal
46
- refine ⟨{env l, ZFSet.pair (ZFSet.pair (env i) (env j)) (env q)}, ?_,
47
- ZFSet.pair (ZFSet.pair (env i) (env j)) (env q),
48
- ZFSet.mem_pair.2 (Or.inr rfl), rfl, equal⟩
49
- rw [equal]
50
- exact ZFSet.mem_pair.2 (Or.inr rfl)
51
-
52
- def liftOldEntryFormula {n} (d maps bound i x y : Fin n) : BoundedFormula n :=
53
- .conj (.mem x d) (exMem bound (.conj (pairMembershipFormula i.succ 0 maps.succ)
54
- (pairMembershipFormula x.succ y.succ 0)))
55
-
56
- theorem truth_liftOldEntryFormula {n} (d maps bound i x y : Fin n)
57
- (env : Fin n → ZFSet.{u}) :
58
- Truth (liftOldEntryFormula d maps bound i x y) env ↔
59
- env x ∈ env d ∧ ∃ S ∈ env bound,
60
- ZFSet.pair (env i) S ∈ env maps ∧ ZFSet.pair (env x) (env y) ∈ S := by
61
- simp only [liftOldEntryFormula, Truth, truth_exMem, truth_pairMembershipFormula]
62
- rfl
63
-
64
- def liftFreshEntryFormula {n} (d l j b ns sources fs bound reps g action i x y : Fin n) : BoundedFormula n :=
65
- let up (t : Fin n) := t.succ.succ.succ.succ
66
- exMem j (exMem b.succ (exMem d.succ.succ (exMem bound.succ.succ.succ
67
- (.conj (rightTripleFormula (up x) (up d) 3 2)
68
- (.conj (pairMembershipFormula 3 2 (up ns))
69
- (.conj (pairMembershipFormula (up i) 1 (up sources))
70
- (.conj (pairMembershipFormula 3 0 (up fs))
71
- (disj (.conj (.mem 1 0) (exMem (up g)
72
- (.conj (pairMembershipFormula (up i).succ 0 (up reps).succ)
73
- (tripleMembershipFormula 0 (up x).succ (up y).succ (up action).succ))))
74
- (.conj (.neg (.mem 1 0)) (taggedPairTripleFormula (up y) (up l) (up i) 3 2))))))))))
75
-
76
- theorem truth_liftFreshEntryFormula {n} (d l j b ns sources fs bound reps g action i x y : Fin n)
77
- (env : Fin n → ZFSet.{u}) :
78
- Truth (liftFreshEntryFormula d l j b ns sources fs bound reps g action i x y) env ↔
79
- ∃ h ∈ env j, ∃ q ∈ env b, ∃ a ∈ env d, ∃ F ∈ env bound,
80
- env x = ZFSet.pair (env d) (ZFSet.pair h q) ∧ ZFSet.pair h q ∈ env ns ∧
81
- ZFSet.pair (env i) a ∈ env sources ∧ ZFSet.pair h F ∈ env fs ∧
82
- ((a ∈ F ∧ ∃ actor ∈ env g, ZFSet.pair (env i) actor ∈ env reps ∧
83
- ZFSet.pair (ZFSet.pair actor (env x)) (env y) ∈ env action) ∨
84
- (a ∉ F ∧ env y = ZFSet.pair (env l) (ZFSet.pair (ZFSet.pair (env i) h) q))) := by
85
- simp only [liftFreshEntryFormula, truth_exMem, Truth, truth_disj,
86
- truth_rightTripleFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula,
87
- truth_taggedPairTripleFormula]
88
- rfl
89
-
90
- def liftedCompressionEntryFormula {n} (z i j d l c ns b maps sources fs reps g action v w : Fin n) :
91
- BoundedFormula n :=
92
- let up (t : Fin n) := t.succ.succ.succ
93
- exMem i (exMem l.succ (exMem c.succ.succ
94
- (.conj (orderedTripleFormula (up z) 2 1 0)
95
- (disj (liftOldEntryFormula (up d) (up maps) (up v) 2 1 0)
96
- (liftFreshEntryFormula (up d) (up l) (up j) (up b) (up ns)
97
- (up sources) (up fs) (up w) (up reps) (up g) (up action) 2 1 0)))))
98
-
99
- theorem truth_liftedCompressionEntryFormula {n} (z i j d l c ns b maps sources fs reps g action v w : Fin n)
100
- (env : Fin n → ZFSet.{u}) (mapsBound : env v = ZFSet.sUnion (ZFSet.sUnion (env maps)))
101
- (filterBound : env w = ZFSet.sUnion (ZFSet.sUnion (env fs))) :
102
- Truth (liftedCompressionEntryFormula z i j d l c ns b maps sources fs reps g action v w) env ↔
103
- ∃ task ∈ env i, ∃ x ∈ env l, ∃ y ∈ env c,
104
- env z = ZFSet.pair (ZFSet.pair task x) y ∧
105
- (liftOldEntry (env d) (env maps) task x y ∨
106
- liftFreshEntry (env d) (env l) (env j) (env b) (env ns)
107
- (env sources) (env fs) (env reps) (env g) (env action) task x y) := by
108
- simp only [liftedCompressionEntryFormula, truth_exMem, Truth, truth_disj,
109
- truth_orderedTripleFormula, truth_liftOldEntryFormula, truth_liftFreshEntryFormula]
110
- simp only [liftOldEntry, liftFreshEntry, extend, Fin.cases_succ, Fin.cases_zero,
111
- mapsBound, filterBound]
112
- rfl
113
-
114
- end PartitionPilot.Forcing.BoundedFormula
115
-
116
- end
117
-
118
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Geometry.LiftedCompressionFunctions
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing.BoundedFormula
8
+
9
+ open SetFormula
10
+ universe u
11
+
12
+ def rightTripleFormula {n} (z a b c : Fin n) : BoundedFormula n :=
13
+ exMem z (exMem 0 (.conj (orderedPairFormula 0 b.succ.succ c.succ.succ)
14
+ (orderedPairFormula z.succ.succ a.succ.succ 0)))
15
+
16
+ theorem truth_rightTripleFormula {n} (z a b c : Fin n) (env : Fin n → ZFSet.{u}) :
17
+ Truth (rightTripleFormula z a b c) env ↔
18
+ env z = ZFSet.pair (env a) (ZFSet.pair (env b) (env c)) := by
19
+ simp only [rightTripleFormula, truth_exMem, Truth, truth_orderedPairFormula]
20
+ change (∃ s ∈ env z, ∃ t ∈ s, t = ZFSet.pair (env b) (env c) ∧
21
+ env z = ZFSet.pair (env a) t) ↔ _
22
+ constructor
23
+ · rintro ⟨_, _, _, _, rfl, equal⟩
24
+ exact equal
25
+ · intro equal
26
+ refine ⟨{env a, ZFSet.pair (env b) (env c)}, ?_, ZFSet.pair (env b) (env c),
27
+ ZFSet.mem_pair.2 (Or.inr rfl), rfl, equal⟩
28
+ rw [equal]
29
+ exact ZFSet.mem_pair.2 (Or.inr rfl)
30
+
31
+ def taggedPairTripleFormula {n} (z l i j q : Fin n) : BoundedFormula n :=
32
+ exMem z (exMem 0 (.conj (orderedTripleFormula 0 i.succ.succ j.succ.succ q.succ.succ)
33
+ (orderedPairFormula z.succ.succ l.succ.succ 0)))
34
+
35
+ theorem truth_taggedPairTripleFormula {n} (z l i j q : Fin n) (env : Fin n → ZFSet.{u}) :
36
+ Truth (taggedPairTripleFormula z l i j q) env ↔
37
+ env z = ZFSet.pair (env l) (ZFSet.pair (ZFSet.pair (env i) (env j)) (env q)) := by
38
+ simp only [taggedPairTripleFormula, truth_exMem, Truth, truth_orderedTripleFormula,
39
+ truth_orderedPairFormula]
40
+ change (∃ s ∈ env z, ∃ t ∈ s, t = ZFSet.pair (ZFSet.pair (env i) (env j)) (env q) ∧
41
+ env z = ZFSet.pair (env l) t) ↔ _
42
+ constructor
43
+ · rintro ⟨_, _, _, _, rfl, equal⟩
44
+ exact equal
45
+ · intro equal
46
+ refine ⟨{env l, ZFSet.pair (ZFSet.pair (env i) (env j)) (env q)}, ?_,
47
+ ZFSet.pair (ZFSet.pair (env i) (env j)) (env q),
48
+ ZFSet.mem_pair.2 (Or.inr rfl), rfl, equal⟩
49
+ rw [equal]
50
+ exact ZFSet.mem_pair.2 (Or.inr rfl)
51
+
52
+ def liftOldEntryFormula {n} (d maps bound i x y : Fin n) : BoundedFormula n :=
53
+ .conj (.mem x d) (exMem bound (.conj (pairMembershipFormula i.succ 0 maps.succ)
54
+ (pairMembershipFormula x.succ y.succ 0)))
55
+
56
+ theorem truth_liftOldEntryFormula {n} (d maps bound i x y : Fin n)
57
+ (env : Fin n → ZFSet.{u}) :
58
+ Truth (liftOldEntryFormula d maps bound i x y) env ↔
59
+ env x ∈ env d ∧ ∃ S ∈ env bound,
60
+ ZFSet.pair (env i) S ∈ env maps ∧ ZFSet.pair (env x) (env y) ∈ S := by
61
+ simp only [liftOldEntryFormula, Truth, truth_exMem, truth_pairMembershipFormula]
62
+ rfl
63
+
64
+ def liftFreshEntryFormula {n} (d l j b ns sources fs bound reps g action i x y : Fin n) : BoundedFormula n :=
65
+ let up (t : Fin n) := t.succ.succ.succ.succ
66
+ exMem j (exMem b.succ (exMem d.succ.succ (exMem bound.succ.succ.succ
67
+ (.conj (rightTripleFormula (up x) (up d) 3 2)
68
+ (.conj (pairMembershipFormula 3 2 (up ns))
69
+ (.conj (pairMembershipFormula (up i) 1 (up sources))
70
+ (.conj (pairMembershipFormula 3 0 (up fs))
71
+ (disj (.conj (.mem 1 0) (exMem (up g)
72
+ (.conj (pairMembershipFormula (up i).succ 0 (up reps).succ)
73
+ (tripleMembershipFormula 0 (up x).succ (up y).succ (up action).succ))))
74
+ (.conj (.neg (.mem 1 0)) (taggedPairTripleFormula (up y) (up l) (up i) 3 2))))))))))
75
+
76
+ theorem truth_liftFreshEntryFormula {n} (d l j b ns sources fs bound reps g action i x y : Fin n)
77
+ (env : Fin n → ZFSet.{u}) :
78
+ Truth (liftFreshEntryFormula d l j b ns sources fs bound reps g action i x y) env ↔
79
+ ∃ h ∈ env j, ∃ q ∈ env b, ∃ a ∈ env d, ∃ F ∈ env bound,
80
+ env x = ZFSet.pair (env d) (ZFSet.pair h q) ∧ ZFSet.pair h q ∈ env ns ∧
81
+ ZFSet.pair (env i) a ∈ env sources ∧ ZFSet.pair h F ∈ env fs ∧
82
+ ((a ∈ F ∧ ∃ actor ∈ env g, ZFSet.pair (env i) actor ∈ env reps ∧
83
+ ZFSet.pair (ZFSet.pair actor (env x)) (env y) ∈ env action) ∨
84
+ (a ∉ F ∧ env y = ZFSet.pair (env l) (ZFSet.pair (ZFSet.pair (env i) h) q))) := by
85
+ simp only [liftFreshEntryFormula, truth_exMem, Truth, truth_disj,
86
+ truth_rightTripleFormula, truth_pairMembershipFormula, truth_tripleMembershipFormula,
87
+ truth_taggedPairTripleFormula]
88
+ rfl
89
+
90
+ def liftedCompressionEntryFormula {n} (z i j d l c ns b maps sources fs reps g action v w : Fin n) :
91
+ BoundedFormula n :=
92
+ let up (t : Fin n) := t.succ.succ.succ
93
+ exMem i (exMem l.succ (exMem c.succ.succ
94
+ (.conj (orderedTripleFormula (up z) 2 1 0)
95
+ (disj (liftOldEntryFormula (up d) (up maps) (up v) 2 1 0)
96
+ (liftFreshEntryFormula (up d) (up l) (up j) (up b) (up ns)
97
+ (up sources) (up fs) (up w) (up reps) (up g) (up action) 2 1 0)))))
98
+
99
+ theorem truth_liftedCompressionEntryFormula {n} (z i j d l c ns b maps sources fs reps g action v w : Fin n)
100
+ (env : Fin n → ZFSet.{u}) (mapsBound : env v = ZFSet.sUnion (ZFSet.sUnion (env maps)))
101
+ (filterBound : env w = ZFSet.sUnion (ZFSet.sUnion (env fs))) :
102
+ Truth (liftedCompressionEntryFormula z i j d l c ns b maps sources fs reps g action v w) env ↔
103
+ ∃ task ∈ env i, ∃ x ∈ env l, ∃ y ∈ env c,
104
+ env z = ZFSet.pair (ZFSet.pair task x) y ∧
105
+ (liftOldEntry (env d) (env maps) task x y ∨
106
+ liftFreshEntry (env d) (env l) (env j) (env b) (env ns)
107
+ (env sources) (env fs) (env reps) (env g) (env action) task x y) := by
108
+ simp only [liftedCompressionEntryFormula, truth_exMem, Truth, truth_disj,
109
+ truth_orderedTripleFormula, truth_liftOldEntryFormula, truth_liftFreshEntryFormula]
110
+ simp only [liftOldEntry, liftFreshEntry, extend, Fin.cases_succ, Fin.cases_zero,
111
+ mapsBound, filterBound]
112
+ rfl
113
+
114
+ end PartitionPilot.Forcing.BoundedFormula
115
+
116
+ end
117
+
118
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedMainInvariantCodes.lean CHANGED
@@ -1,68 +1,68 @@
1
- import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageInvariant
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
- open SetFormula
9
- universe u
10
-
11
- def LinkedMainInvariantCode (M : TransitiveGround.{u})
12
- (K Labels C D P G cutoff serial : ZFSet.{u}) : Prop :=
13
- GroundBelow M P K ∧ GroundBelow M G K ∧ GroundBelow M Labels K ∧
14
- ZFSet.rank P < ZFSet.rank K ∧ ZFSet.rank G < ZFSet.rank K ∧
15
- ZFSet.rank Labels < ZFSet.rank K ∧ cutoff ∈ K ∧
16
- ZFSet.rank C < ZFSet.rank K ∧ ZFSet.rank D < ZFSet.rank K ∧
17
- ZFSet.rank serial < ZFSet.rank K
18
-
19
- namespace SetFormula
20
-
21
- def linkedMainInvariantFormula {n} (K Labels C D P G cutoff serial : Fin n) : SetFormula n :=
22
- .conj (groundBelowFormula P K) (.conj (groundBelowFormula G K)
23
- (.conj (groundBelowFormula Labels K) (.conj (cumulativeRankLtFormula P K)
24
- (.conj (cumulativeRankLtFormula G K) (.conj (cumulativeRankLtFormula Labels K)
25
- (.conj (.mem cutoff K) (.conj (cumulativeRankLtFormula C K)
26
- (.conj (cumulativeRankLtFormula D K) (cumulativeRankLtFormula serial K)))))))))
27
- end SetFormula
28
-
29
- namespace TransitiveGround
30
- variable (M : TransitiveGround.{u})
31
-
32
- theorem realize_linkedMainInvariantFormula
33
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
34
- (unions : Realize M.sets SetFormula.union Fin.elim0)
35
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
36
- (collection : CollectionSchema M.sets) {n}
37
- (K Labels C D P G cutoff serial : Fin n) (env : Fin n → ZFSet.{u})
38
- (members : ∀ i, env i ∈ M.sets) (ordinal : ordinalSetProperty (env K)) :
39
- Realize M.sets (linkedMainInvariantFormula K Labels C D P G cutoff serial) env ↔
40
- LinkedMainInvariantCode M (env K) (env Labels) (env C) (env D)
41
- (env P) (env G) (env cutoff) (env serial) := by
42
- change (Realize M.sets (groundBelowFormula P K) env ∧
43
- Realize M.sets (groundBelowFormula G K) env ∧
44
- Realize M.sets (groundBelowFormula Labels K) env ∧
45
- Realize M.sets (cumulativeRankLtFormula P K) env ∧
46
- Realize M.sets (cumulativeRankLtFormula G K) env ∧
47
- Realize M.sets (cumulativeRankLtFormula Labels K) env ∧ env cutoff ∈ env K ∧
48
- Realize M.sets (cumulativeRankLtFormula C K) env ∧
49
- Realize M.sets (cumulativeRankLtFormula D K) env ∧
50
- Realize M.sets (cumulativeRankLtFormula serial K) env) ↔ _
51
- rw [M.realize_groundBelowFormula P K env members,
52
- M.realize_groundBelowFormula G K env members,
53
- M.realize_groundBelowFormula Labels K env members,
54
- M.realize_cumulativeRankLtFormula pairing unions powers separation collection P K env members ordinal,
55
- M.realize_cumulativeRankLtFormula pairing unions powers separation collection G K env members ordinal,
56
- M.realize_cumulativeRankLtFormula pairing unions powers separation collection Labels K env members ordinal,
57
- M.realize_cumulativeRankLtFormula pairing unions powers separation collection C K env members ordinal,
58
- M.realize_cumulativeRankLtFormula pairing unions powers separation collection D K env members ordinal,
59
- M.realize_cumulativeRankLtFormula pairing unions powers separation collection serial K env members ordinal]
60
- rfl
61
-
62
- end TransitiveGround
63
-
64
- end PartitionPilot.Forcing
65
-
66
- end
67
-
68
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainStageInvariant
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+ open SetFormula
9
+ universe u
10
+
11
+ def LinkedMainInvariantCode (M : TransitiveGround.{u})
12
+ (K Labels C D P G cutoff serial : ZFSet.{u}) : Prop :=
13
+ GroundBelow M P K ∧ GroundBelow M G K ∧ GroundBelow M Labels K ∧
14
+ ZFSet.rank P < ZFSet.rank K ∧ ZFSet.rank G < ZFSet.rank K ∧
15
+ ZFSet.rank Labels < ZFSet.rank K ∧ cutoff ∈ K ∧
16
+ ZFSet.rank C < ZFSet.rank K ∧ ZFSet.rank D < ZFSet.rank K ∧
17
+ ZFSet.rank serial < ZFSet.rank K
18
+
19
+ namespace SetFormula
20
+
21
+ def linkedMainInvariantFormula {n} (K Labels C D P G cutoff serial : Fin n) : SetFormula n :=
22
+ .conj (groundBelowFormula P K) (.conj (groundBelowFormula G K)
23
+ (.conj (groundBelowFormula Labels K) (.conj (cumulativeRankLtFormula P K)
24
+ (.conj (cumulativeRankLtFormula G K) (.conj (cumulativeRankLtFormula Labels K)
25
+ (.conj (.mem cutoff K) (.conj (cumulativeRankLtFormula C K)
26
+ (.conj (cumulativeRankLtFormula D K) (cumulativeRankLtFormula serial K)))))))))
27
+ end SetFormula
28
+
29
+ namespace TransitiveGround
30
+ variable (M : TransitiveGround.{u})
31
+
32
+ theorem realize_linkedMainInvariantFormula
33
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
34
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
35
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
36
+ (collection : CollectionSchema M.sets) {n}
37
+ (K Labels C D P G cutoff serial : Fin n) (env : Fin n → ZFSet.{u})
38
+ (members : ∀ i, env i ∈ M.sets) (ordinal : ordinalSetProperty (env K)) :
39
+ Realize M.sets (linkedMainInvariantFormula K Labels C D P G cutoff serial) env ↔
40
+ LinkedMainInvariantCode M (env K) (env Labels) (env C) (env D)
41
+ (env P) (env G) (env cutoff) (env serial) := by
42
+ change (Realize M.sets (groundBelowFormula P K) env ∧
43
+ Realize M.sets (groundBelowFormula G K) env ∧
44
+ Realize M.sets (groundBelowFormula Labels K) env ∧
45
+ Realize M.sets (cumulativeRankLtFormula P K) env ∧
46
+ Realize M.sets (cumulativeRankLtFormula G K) env ∧
47
+ Realize M.sets (cumulativeRankLtFormula Labels K) env ∧ env cutoff ∈ env K ∧
48
+ Realize M.sets (cumulativeRankLtFormula C K) env ∧
49
+ Realize M.sets (cumulativeRankLtFormula D K) env ∧
50
+ Realize M.sets (cumulativeRankLtFormula serial K) env) ↔ _
51
+ rw [M.realize_groundBelowFormula P K env members,
52
+ M.realize_groundBelowFormula G K env members,
53
+ M.realize_groundBelowFormula Labels K env members,
54
+ M.realize_cumulativeRankLtFormula pairing unions powers separation collection P K env members ordinal,
55
+ M.realize_cumulativeRankLtFormula pairing unions powers separation collection G K env members ordinal,
56
+ M.realize_cumulativeRankLtFormula pairing unions powers separation collection Labels K env members ordinal,
57
+ M.realize_cumulativeRankLtFormula pairing unions powers separation collection C K env members ordinal,
58
+ M.realize_cumulativeRankLtFormula pairing unions powers separation collection D K env members ordinal,
59
+ M.realize_cumulativeRankLtFormula pairing unions powers separation collection serial K env members ordinal]
60
+ rfl
61
+
62
+ end TransitiveGround
63
+
64
+ end PartitionPilot.Forcing
65
+
66
+ end
67
+
68
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedMainTransitionRawCodes.lean CHANGED
@@ -1,177 +1,177 @@
1
- import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundLinkedMainStageCodeLaws
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing.BoundedFormula
8
- open SetFormula
9
- universe u
10
-
11
- def chronologicalMainTransitionFormula {n}
12
- (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth : Fin n)
13
- (sourceGraphs targetGraphs : Fin 5 → Fin n) : BoundedFormula n :=
14
- .conj (validMainTransitionCodeFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors)
15
- (chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff sourceBirth targetBirth
16
- sourceGraphs targetGraphs)
17
-
18
- theorem truth_chronologicalMainTransitionFormula {n}
19
- (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth : Fin n)
20
- (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) :
21
- Truth (chronologicalMainTransitionFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth sourceGraphs targetGraphs) env ↔
22
- env z = ZFSet.pair (env points) (env actors) ∧
23
- MainTransitionLaws (env P) (env Q) (env rP) (env rQ) (env μP) (env μQ) (env G) (env H) (env mG) (env mH) (env oneG) (env oneH) (env AP) (env AQ) (env bP) (env bQ) (env heightP) (env heightQ) (env points) (env actors) ∧
24
- ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff)
25
- (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j))
26
- (fun j => env (targetGraphs j)) := by
27
- change (Truth (validMainTransitionCodeFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors) env ∧
28
- Truth (chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff sourceBirth targetBirth
29
- sourceGraphs targetGraphs) env) ↔ _
30
- rw [truth_validMainTransitionCodeFormula]
31
- constructor
32
- · rintro ⟨⟨encoded, laws⟩, chronological⟩
33
- exact ⟨encoded, laws, (truth_chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff
34
- sourceBirth targetBirth sourceGraphs targetGraphs env laws.point_embedding.injection.function.1).1 chronological⟩
35
- · rintro ⟨encoded, laws, chronological⟩
36
- exact ⟨⟨encoded, laws⟩, (truth_chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff
37
- sourceBirth targetBirth sourceGraphs targetGraphs env laws.point_embedding.injection.function.1).2 chronological⟩
38
-
39
- theorem realize_chronologicalMainTransitionFormula (M : TransitiveGround.{u}) {n}
40
- (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth : Fin n)
41
- (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u})
42
- (members : ∀ i, env i ∈ M.sets) :
43
- Realize M.sets (chronologicalMainTransitionFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth
44
- sourceGraphs targetGraphs).toFormula env ↔
45
- env z = ZFSet.pair (env points) (env actors) ∧
46
- MainTransitionLaws (env P) (env Q) (env rP) (env rQ) (env μP) (env μQ) (env G) (env H) (env mG) (env mH) (env oneG) (env oneH) (env AP) (env AQ) (env bP) (env bQ) (env heightP) (env heightQ) (env points) (env actors) ∧
47
- ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff)
48
- (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j))
49
- (fun j => env (targetGraphs j)) :=
50
- (realize_toFormula M _ env members).trans
51
- (truth_chronologicalMainTransitionFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth sourceGraphs targetGraphs env)
52
-
53
- def coveredChronologicalMainTransitionFormula {n}
54
- (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth : Fin n)
55
- (sourceGraphs targetGraphs : Fin 5 → Fin n) : BoundedFormula n :=
56
- .conj (chronologicalMainTransitionFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth sourceGraphs targetGraphs)
57
- (oldBirthFiberCoverageFormula P points targetBirth sourceCutoff)
58
-
59
- theorem truth_coveredChronologicalMainTransitionFormula {n}
60
- (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth : Fin n)
61
- (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) :
62
- Truth (coveredChronologicalMainTransitionFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth sourceGraphs targetGraphs) env ↔
63
- (env z = ZFSet.pair (env points) (env actors) ∧
64
- MainTransitionLaws (env P) (env Q) (env rP) (env rQ) (env μP) (env μQ) (env G) (env H) (env mG) (env mH) (env oneG) (env oneH) (env AP) (env AQ) (env bP) (env bQ) (env heightP) (env heightQ) (env points) (env actors) ∧
65
- ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff)
66
- (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j))
67
- (fun j => env (targetGraphs j))) ∧
68
- OldBirthFiberCoverageCode (env P) (env points) (env targetBirth) (env sourceCutoff) := by
69
- simp only [coveredChronologicalMainTransitionFormula, Truth,
70
- truth_chronologicalMainTransitionFormula, truth_oldBirthFiberCoverageFormula]
71
-
72
- theorem realize_coveredChronologicalMainTransitionFormula (M : TransitiveGround.{u}) {n}
73
- (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth : Fin n)
74
- (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u})
75
- (members : ∀ i, env i ∈ M.sets) :
76
- Realize M.sets (coveredChronologicalMainTransitionFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth
77
- sourceGraphs targetGraphs).toFormula env ↔
78
- (env z = ZFSet.pair (env points) (env actors) ∧
79
- MainTransitionLaws (env P) (env Q) (env rP) (env rQ) (env μP) (env μQ) (env G) (env H) (env mG) (env mH) (env oneG) (env oneH) (env AP) (env AQ) (env bP) (env bQ) (env heightP) (env heightQ) (env points) (env actors) ∧
80
- ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff)
81
- (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j))
82
- (fun j => env (targetGraphs j))) ∧
83
- OldBirthFiberCoverageCode (env P) (env points) (env targetBirth) (env sourceCutoff) :=
84
- (realize_toFormula M _ env members).trans
85
- (truth_coveredChronologicalMainTransitionFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth sourceGraphs targetGraphs env)
86
-
87
- end PartitionPilot.Forcing.BoundedFormula
88
-
89
-
90
-
91
- namespace PartitionPilot.Forcing
92
- open SetFormula
93
- universe u
94
-
95
- def LinkedTransitionLawsCode (z points actors sourceBirth targetBirth : ZFSet.{u})
96
- (source target : Fin 24 → ZFSet.{u}) : Prop :=
97
- ZFSet.pair (source 11) sourceBirth ∈ source 17 ∧
98
- ZFSet.pair (target 11) targetBirth ∈ target 17 ∧
99
- (z = ZFSet.pair points actors ∧
100
- MainTransitionLaws (source 0) (target 0) (source 1) (target 1) (source 2) (target 2) (source 3) (target 3) (source 4) (target 4) (source 6) (target 6) (source 7) (target 7) (source 8) (target 8) (source 10) (target 10) points actors ∧
101
- ChronologicalTransitionLaws points (source 11) (target 11) sourceBirth targetBirth
102
- (linkedChronologyGraphs source) (linkedChronologyGraphs target)) ∧
103
- OldBirthFiberCoverageCode (source 0) points targetBirth (source 11)
104
-
105
- def LinkedMainTransitionRawCode (M : TransitiveGround.{u})
106
- (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : ZFSet.{u})
107
- (source target : Fin 24 → ZFSet.{u}) : Prop :=
108
- LinkedMainStageRawCode M K Labels C D rD N sourceCode source ∧
109
- LinkedMainStageRawCode M K Labels C D rD N targetCode target ∧
110
- LinkedTransitionLawsCode z points actors sourceBirth targetBirth source target
111
-
112
- namespace BoundedFormula
113
-
114
- def linkedTransitionLawsFormula {n} (z points actors sourceBirth targetBirth : Fin n)
115
- (f g : Fin 24 → Fin n) : BoundedFormula n :=
116
- .conj (pairMembershipFormula (f 11) sourceBirth (f 17))
117
- (.conj (pairMembershipFormula (g 11) targetBirth (g 17))
118
- (coveredChronologicalMainTransitionFormula z (f 0) (g 0) (f 1) (g 1) (f 2) (g 2) (f 3) (g 3) (f 4) (g 4) (f 6) (g 6) (f 7) (g 7) (f 8) (g 8) (f 10) (g 10)
119
- points actors (f 11) (g 11) sourceBirth targetBirth
120
- (linkedChronologyGraphs f) (linkedChronologyGraphs g)))
121
-
122
- theorem truth_linkedTransitionLawsFormula {n} (z points actors sourceBirth targetBirth : Fin n)
123
- (f g : Fin 24 → Fin n) (env : Fin n → ZFSet.{u}) :
124
- Truth (linkedTransitionLawsFormula z points actors sourceBirth targetBirth f g) env ↔
125
- LinkedTransitionLawsCode (env z) (env points) (env actors) (env sourceBirth) (env targetBirth)
126
- (fun j => env (f j)) (fun j => env (g j)) := by
127
- have map (h : Fin 24 → Fin n) : (fun j => env (linkedChronologyGraphs h j)) =
128
- linkedChronologyGraphs (fun j => env (h j)) := by
129
- funext j
130
- exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun _ => rfl)))) j
131
- simp only [linkedTransitionLawsFormula, Truth, truth_pairMembershipFormula,
132
- truth_coveredChronologicalMainTransitionFormula, map, LinkedTransitionLawsCode]
133
-
134
- end BoundedFormula
135
-
136
- namespace SetFormula
137
-
138
- def linkedMainTransitionRawFormula {n}
139
- (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : Fin n)
140
- (source target : Fin 24 → Fin n) : SetFormula n :=
141
- .conj (linkedMainStageRawFormula K Labels C D rD N sourceCode source)
142
- (.conj (linkedMainStageRawFormula K Labels C D rD N targetCode target)
143
- (BoundedFormula.linkedTransitionLawsFormula z points actors sourceBirth targetBirth source target).toFormula)
144
-
145
- end SetFormula
146
-
147
- namespace TransitiveGround
148
- variable (M : TransitiveGround.{u})
149
-
150
- theorem realize_linkedMainTransitionRawFormula
151
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
152
- (unions : Realize M.sets SetFormula.union Fin.elim0)
153
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
154
- (collection : CollectionSchema M.sets) {n}
155
- (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : Fin n)
156
- (source target : Fin 24 → Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
157
- (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) :
158
- Realize M.sets (linkedMainTransitionRawFormula K Labels C D rD N sourceCode targetCode z
159
- points actors sourceBirth targetBirth source target) env ↔
160
- LinkedMainTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N)
161
- (env sourceCode) (env targetCode) (env z) (env points) (env actors) (env sourceBirth) (env targetBirth)
162
- (fun j => env (source j)) (fun j => env (target j)) := by
163
- have first := M.realize_linkedMainStageRawFormula pairing unions powers separation collection
164
- K Labels C D rD N sourceCode source env members omega ordinal
165
- have second := M.realize_linkedMainStageRawFormula pairing unions powers separation collection
166
- K Labels C D rD N targetCode target env members omega ordinal
167
- have laws := (BoundedFormula.realize_toFormula M _ env members).trans
168
- (BoundedFormula.truth_linkedTransitionLawsFormula z points actors sourceBirth targetBirth source target env)
169
- exact and_congr first (and_congr second laws)
170
-
171
- end TransitiveGround
172
-
173
- end PartitionPilot.Forcing
174
-
175
- end
176
-
177
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundLinkedMainStageCodeLaws
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing.BoundedFormula
8
+ open SetFormula
9
+ universe u
10
+
11
+ def chronologicalMainTransitionFormula {n}
12
+ (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth : Fin n)
13
+ (sourceGraphs targetGraphs : Fin 5 → Fin n) : BoundedFormula n :=
14
+ .conj (validMainTransitionCodeFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors)
15
+ (chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff sourceBirth targetBirth
16
+ sourceGraphs targetGraphs)
17
+
18
+ theorem truth_chronologicalMainTransitionFormula {n}
19
+ (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth : Fin n)
20
+ (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) :
21
+ Truth (chronologicalMainTransitionFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth sourceGraphs targetGraphs) env ↔
22
+ env z = ZFSet.pair (env points) (env actors) ∧
23
+ MainTransitionLaws (env P) (env Q) (env rP) (env rQ) (env μP) (env μQ) (env G) (env H) (env mG) (env mH) (env oneG) (env oneH) (env AP) (env AQ) (env bP) (env bQ) (env heightP) (env heightQ) (env points) (env actors) ∧
24
+ ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff)
25
+ (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j))
26
+ (fun j => env (targetGraphs j)) := by
27
+ change (Truth (validMainTransitionCodeFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors) env ∧
28
+ Truth (chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff sourceBirth targetBirth
29
+ sourceGraphs targetGraphs) env) ↔ _
30
+ rw [truth_validMainTransitionCodeFormula]
31
+ constructor
32
+ · rintro ⟨⟨encoded, laws⟩, chronological⟩
33
+ exact ⟨encoded, laws, (truth_chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff
34
+ sourceBirth targetBirth sourceGraphs targetGraphs env laws.point_embedding.injection.function.1).1 chronological⟩
35
+ · rintro ⟨encoded, laws, chronological⟩
36
+ exact ⟨⟨encoded, laws⟩, (truth_chronologicalTransitionExtraFormula P Q points sourceCutoff targetCutoff
37
+ sourceBirth targetBirth sourceGraphs targetGraphs env laws.point_embedding.injection.function.1).2 chronological⟩
38
+
39
+ theorem realize_chronologicalMainTransitionFormula (M : TransitiveGround.{u}) {n}
40
+ (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth : Fin n)
41
+ (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u})
42
+ (members : ∀ i, env i ∈ M.sets) :
43
+ Realize M.sets (chronologicalMainTransitionFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth
44
+ sourceGraphs targetGraphs).toFormula env ↔
45
+ env z = ZFSet.pair (env points) (env actors) ∧
46
+ MainTransitionLaws (env P) (env Q) (env rP) (env rQ) (env μP) (env μQ) (env G) (env H) (env mG) (env mH) (env oneG) (env oneH) (env AP) (env AQ) (env bP) (env bQ) (env heightP) (env heightQ) (env points) (env actors) ∧
47
+ ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff)
48
+ (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j))
49
+ (fun j => env (targetGraphs j)) :=
50
+ (realize_toFormula M _ env members).trans
51
+ (truth_chronologicalMainTransitionFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth sourceGraphs targetGraphs env)
52
+
53
+ def coveredChronologicalMainTransitionFormula {n}
54
+ (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth : Fin n)
55
+ (sourceGraphs targetGraphs : Fin 5 → Fin n) : BoundedFormula n :=
56
+ .conj (chronologicalMainTransitionFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth sourceGraphs targetGraphs)
57
+ (oldBirthFiberCoverageFormula P points targetBirth sourceCutoff)
58
+
59
+ theorem truth_coveredChronologicalMainTransitionFormula {n}
60
+ (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth : Fin n)
61
+ (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u}) :
62
+ Truth (coveredChronologicalMainTransitionFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth sourceGraphs targetGraphs) env ↔
63
+ (env z = ZFSet.pair (env points) (env actors) ∧
64
+ MainTransitionLaws (env P) (env Q) (env rP) (env rQ) (env μP) (env μQ) (env G) (env H) (env mG) (env mH) (env oneG) (env oneH) (env AP) (env AQ) (env bP) (env bQ) (env heightP) (env heightQ) (env points) (env actors) ∧
65
+ ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff)
66
+ (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j))
67
+ (fun j => env (targetGraphs j))) ∧
68
+ OldBirthFiberCoverageCode (env P) (env points) (env targetBirth) (env sourceCutoff) := by
69
+ simp only [coveredChronologicalMainTransitionFormula, Truth,
70
+ truth_chronologicalMainTransitionFormula, truth_oldBirthFiberCoverageFormula]
71
+
72
+ theorem realize_coveredChronologicalMainTransitionFormula (M : TransitiveGround.{u}) {n}
73
+ (z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth : Fin n)
74
+ (sourceGraphs targetGraphs : Fin 5 → Fin n) (env : Fin n → ZFSet.{u})
75
+ (members : ∀ i, env i ∈ M.sets) :
76
+ Realize M.sets (coveredChronologicalMainTransitionFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth
77
+ sourceGraphs targetGraphs).toFormula env ↔
78
+ (env z = ZFSet.pair (env points) (env actors) ∧
79
+ MainTransitionLaws (env P) (env Q) (env rP) (env rQ) (env μP) (env μQ) (env G) (env H) (env mG) (env mH) (env oneG) (env oneH) (env AP) (env AQ) (env bP) (env bQ) (env heightP) (env heightQ) (env points) (env actors) ∧
80
+ ChronologicalTransitionLaws (env points) (env sourceCutoff) (env targetCutoff)
81
+ (env sourceBirth) (env targetBirth) (fun j => env (sourceGraphs j))
82
+ (fun j => env (targetGraphs j))) ∧
83
+ OldBirthFiberCoverageCode (env P) (env points) (env targetBirth) (env sourceCutoff) :=
84
+ (realize_toFormula M _ env members).trans
85
+ (truth_coveredChronologicalMainTransitionFormula z P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors sourceCutoff targetCutoff sourceBirth targetBirth sourceGraphs targetGraphs env)
86
+
87
+ end PartitionPilot.Forcing.BoundedFormula
88
+
89
+
90
+
91
+ namespace PartitionPilot.Forcing
92
+ open SetFormula
93
+ universe u
94
+
95
+ def LinkedTransitionLawsCode (z points actors sourceBirth targetBirth : ZFSet.{u})
96
+ (source target : Fin 24 → ZFSet.{u}) : Prop :=
97
+ ZFSet.pair (source 11) sourceBirth ∈ source 17 ∧
98
+ ZFSet.pair (target 11) targetBirth ∈ target 17 ∧
99
+ (z = ZFSet.pair points actors ∧
100
+ MainTransitionLaws (source 0) (target 0) (source 1) (target 1) (source 2) (target 2) (source 3) (target 3) (source 4) (target 4) (source 6) (target 6) (source 7) (target 7) (source 8) (target 8) (source 10) (target 10) points actors ∧
101
+ ChronologicalTransitionLaws points (source 11) (target 11) sourceBirth targetBirth
102
+ (linkedChronologyGraphs source) (linkedChronologyGraphs target)) ∧
103
+ OldBirthFiberCoverageCode (source 0) points targetBirth (source 11)
104
+
105
+ def LinkedMainTransitionRawCode (M : TransitiveGround.{u})
106
+ (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : ZFSet.{u})
107
+ (source target : Fin 24 → ZFSet.{u}) : Prop :=
108
+ LinkedMainStageRawCode M K Labels C D rD N sourceCode source ∧
109
+ LinkedMainStageRawCode M K Labels C D rD N targetCode target ∧
110
+ LinkedTransitionLawsCode z points actors sourceBirth targetBirth source target
111
+
112
+ namespace BoundedFormula
113
+
114
+ def linkedTransitionLawsFormula {n} (z points actors sourceBirth targetBirth : Fin n)
115
+ (f g : Fin 24 → Fin n) : BoundedFormula n :=
116
+ .conj (pairMembershipFormula (f 11) sourceBirth (f 17))
117
+ (.conj (pairMembershipFormula (g 11) targetBirth (g 17))
118
+ (coveredChronologicalMainTransitionFormula z (f 0) (g 0) (f 1) (g 1) (f 2) (g 2) (f 3) (g 3) (f 4) (g 4) (f 6) (g 6) (f 7) (g 7) (f 8) (g 8) (f 10) (g 10)
119
+ points actors (f 11) (g 11) sourceBirth targetBirth
120
+ (linkedChronologyGraphs f) (linkedChronologyGraphs g)))
121
+
122
+ theorem truth_linkedTransitionLawsFormula {n} (z points actors sourceBirth targetBirth : Fin n)
123
+ (f g : Fin 24 → Fin n) (env : Fin n → ZFSet.{u}) :
124
+ Truth (linkedTransitionLawsFormula z points actors sourceBirth targetBirth f g) env ↔
125
+ LinkedTransitionLawsCode (env z) (env points) (env actors) (env sourceBirth) (env targetBirth)
126
+ (fun j => env (f j)) (fun j => env (g j)) := by
127
+ have map (h : Fin 24 → Fin n) : (fun j => env (linkedChronologyGraphs h j)) =
128
+ linkedChronologyGraphs (fun j => env (h j)) := by
129
+ funext j
130
+ exact Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (Fin.cases rfl (fun _ => rfl)))) j
131
+ simp only [linkedTransitionLawsFormula, Truth, truth_pairMembershipFormula,
132
+ truth_coveredChronologicalMainTransitionFormula, map, LinkedTransitionLawsCode]
133
+
134
+ end BoundedFormula
135
+
136
+ namespace SetFormula
137
+
138
+ def linkedMainTransitionRawFormula {n}
139
+ (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : Fin n)
140
+ (source target : Fin 24 → Fin n) : SetFormula n :=
141
+ .conj (linkedMainStageRawFormula K Labels C D rD N sourceCode source)
142
+ (.conj (linkedMainStageRawFormula K Labels C D rD N targetCode target)
143
+ (BoundedFormula.linkedTransitionLawsFormula z points actors sourceBirth targetBirth source target).toFormula)
144
+
145
+ end SetFormula
146
+
147
+ namespace TransitiveGround
148
+ variable (M : TransitiveGround.{u})
149
+
150
+ theorem realize_linkedMainTransitionRawFormula
151
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
152
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
153
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
154
+ (collection : CollectionSchema M.sets) {n}
155
+ (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth : Fin n)
156
+ (source target : Fin 24 → Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
157
+ (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) :
158
+ Realize M.sets (linkedMainTransitionRawFormula K Labels C D rD N sourceCode targetCode z
159
+ points actors sourceBirth targetBirth source target) env ↔
160
+ LinkedMainTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N)
161
+ (env sourceCode) (env targetCode) (env z) (env points) (env actors) (env sourceBirth) (env targetBirth)
162
+ (fun j => env (source j)) (fun j => env (target j)) := by
163
+ have first := M.realize_linkedMainStageRawFormula pairing unions powers separation collection
164
+ K Labels C D rD N sourceCode source env members omega ordinal
165
+ have second := M.realize_linkedMainStageRawFormula pairing unions powers separation collection
166
+ K Labels C D rD N targetCode target env members omega ordinal
167
+ have laws := (BoundedFormula.realize_toFormula M _ env members).trans
168
+ (BoundedFormula.truth_linkedTransitionLawsFormula z points actors sourceBirth targetBirth source target env)
169
+ exact and_congr first (and_congr second laws)
170
+
171
+ end TransitiveGround
172
+
173
+ end PartitionPilot.Forcing
174
+
175
+ end
176
+
177
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/LinkedProfileTransitionRawCodes.lean CHANGED
@@ -1,113 +1,113 @@
1
- import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLinkedProfilePreservation
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
- open SetFormula
9
- universe u
10
-
11
- def LinkedProfilePreservingTransitionRawCode (M : TransitiveGround.{u})
12
- (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth Families : ZFSet.{u})
13
- (source target : Fin 24 → ZFSet.{u}) : Prop :=
14
- LinkedMainTransitionRawCode M K Labels C D rD N sourceCode targetCode z points actors
15
- sourceBirth targetBirth source target ∧
16
- Families = M.groundPower (source 0) ∧
17
- OldProfilePreservationCode (source 0) (source 1) (source 2)
18
- (target 0) (target 1) (target 2) points Families
19
-
20
- namespace SetFormula
21
- def linkedProfilePreservingTransitionRawFormula {n}
22
- (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth Families : Fin n)
23
- (source target : Fin 24 → Fin n) : SetFormula n :=
24
- .conj (linkedMainTransitionRawFormula K Labels C D rD N sourceCode targetCode z points actors
25
- sourceBirth targetBirth source target)
26
- (.conj (relativePowerFormula (source 0) Families)
27
- (BoundedFormula.oldProfilePreservationFormula (source 0) (source 1) (source 2)
28
- (target 0) (target 1) (target 2) points Families).toFormula)
29
-
30
- end SetFormula
31
-
32
- namespace TransitiveGround
33
- variable (M : TransitiveGround.{u})
34
- theorem realize_linkedProfilePreservingTransitionRawFormula
35
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
36
- (unions : Realize M.sets SetFormula.union Fin.elim0)
37
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
38
- (collection : CollectionSchema M.sets) {n}
39
- (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth Families : Fin n)
40
- (source target : Fin 24 → Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
41
- (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) :
42
- Realize M.sets (linkedProfilePreservingTransitionRawFormula K Labels C D rD N sourceCode targetCode z
43
- points actors sourceBirth targetBirth Families source target) env ↔
44
- LinkedProfilePreservingTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD)
45
- (env N) (env sourceCode) (env targetCode) (env z) (env points) (env actors)
46
- (env sourceBirth) (env targetBirth) (env Families)
47
- (fun j => env (source j)) (fun j => env (target j)) :=
48
- (M.realize_linkedMainTransitionRawFormula pairing unions powers separation collection
49
- K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth source target
50
- env members omega ordinal).and
51
- ((M.realize_relativePowerFormula (source 0) Families env members).and
52
- (BoundedFormula.realize_oldProfilePreservationFormula M (source 0) (source 1) (source 2)
53
- (target 0) (target 1) (target 2) points Families env members))
54
-
55
- end TransitiveGround
56
-
57
- namespace LinkedProfilePreservingTransitionRawCode
58
- variable {M : TransitiveGround.{u}}
59
- variable {K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth Families : ZFSet.{u}}
60
- variable {source target : Fin 24 → ZFSet.{u}}
61
-
62
- theorem exists_transition
63
- (raw : LinkedProfilePreservingTransitionRawCode M K Labels C D rD N sourceCode targetCode z
64
- points actors sourceBirth targetBirth Families source target)
65
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
66
- (unions : Realize M.sets SetFormula.union Fin.elim0)
67
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
68
- (sourceGround : ∀ j, source j ∈ M.sets) (targetGround : ∀ j, target j ∈ M.sets)
69
- (hPoints : points ∈ M.sets) (hActors : actors ∈ M.sets)
70
- (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (omega : N = ZFSet.omega) :
71
- LinkedProfilePreservingTransitionCode M K Labels C D rD sourceCode targetCode z := by
72
- rw [omega] at raw
73
- obtain ⟨s, t, sourceEqual, targetEqual, transition, equal, covered⟩ :=
74
- raw.1.exists_transition pairing unions powers separation sourceGround targetGround
75
- hPoints hActors hC hD hrD rfl
76
- have sourceCode := s.rawFields_code
77
- have targetCode := t.rawFields_code
78
- rw [sourceEqual] at sourceCode
79
- rw [targetEqual] at targetCode
80
- have sourceFields := sourceCode.fields_unique raw.1.1
81
- have targetFields := targetCode.fields_unique raw.1.2.1
82
- have mapEqual : ZFSet.pair transition.map.points transition.map.actors = ZFSet.pair points actors :=
83
- equal.trans raw.1.2.2.2.2.1.1
84
- have pointsEqual := (ZFSet.pair_inj.1 mapEqual).1
85
- have preservation := raw.2.2
86
- rw [raw.2.1, ← sourceFields, ← targetFields] at preservation
87
- refine ⟨s, t, sourceEqual, targetEqual, transition, equal, covered, ?_⟩
88
- change OldProfilePreservationCode s.main.stage.carrier s.main.stage.order s.main.stage.meetGraph
89
- t.main.stage.carrier t.main.stage.order t.main.stage.meetGraph
90
- transition.map.points (M.groundPower s.main.stage.carrier)
91
- rw [pointsEqual]
92
- exact preservation
93
-
94
- end LinkedProfilePreservingTransitionRawCode
95
-
96
- namespace GroundLinkedMainStage
97
- variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}}
98
- variable (source target : GroundLinkedMainStage M K Labels C D rD)
99
- theorem profileTransition_rawFields
100
- (transition : GroundChronologicalMainTransition source.main target.main)
101
- (covered : transition.CoversOldBirths) (preserved : transition.PreservesOldProfiles) :
102
- LinkedProfilePreservingTransitionRawCode M K Labels C D rD ZFSet.omega source.code target.code
103
- transition.map.code transition.map.points transition.map.actors source.main.birth target.main.birth
104
- (M.groundPower source.main.stage.carrier) source.rawFields target.rawFields :=
105
- ⟨source.transition_rawFields target transition covered, rfl, preserved⟩
106
-
107
- end GroundLinkedMainStage
108
-
109
- end PartitionPilot.Forcing
110
-
111
- end
112
-
113
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Geometry.GroundLinkedProfilePreservation
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+ open SetFormula
9
+ universe u
10
+
11
+ def LinkedProfilePreservingTransitionRawCode (M : TransitiveGround.{u})
12
+ (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth Families : ZFSet.{u})
13
+ (source target : Fin 24 → ZFSet.{u}) : Prop :=
14
+ LinkedMainTransitionRawCode M K Labels C D rD N sourceCode targetCode z points actors
15
+ sourceBirth targetBirth source target ∧
16
+ Families = M.groundPower (source 0) ∧
17
+ OldProfilePreservationCode (source 0) (source 1) (source 2)
18
+ (target 0) (target 1) (target 2) points Families
19
+
20
+ namespace SetFormula
21
+ def linkedProfilePreservingTransitionRawFormula {n}
22
+ (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth Families : Fin n)
23
+ (source target : Fin 24 → Fin n) : SetFormula n :=
24
+ .conj (linkedMainTransitionRawFormula K Labels C D rD N sourceCode targetCode z points actors
25
+ sourceBirth targetBirth source target)
26
+ (.conj (relativePowerFormula (source 0) Families)
27
+ (BoundedFormula.oldProfilePreservationFormula (source 0) (source 1) (source 2)
28
+ (target 0) (target 1) (target 2) points Families).toFormula)
29
+
30
+ end SetFormula
31
+
32
+ namespace TransitiveGround
33
+ variable (M : TransitiveGround.{u})
34
+ theorem realize_linkedProfilePreservingTransitionRawFormula
35
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
36
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
37
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
38
+ (collection : CollectionSchema M.sets) {n}
39
+ (K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth Families : Fin n)
40
+ (source target : Fin 24 → Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
41
+ (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) :
42
+ Realize M.sets (linkedProfilePreservingTransitionRawFormula K Labels C D rD N sourceCode targetCode z
43
+ points actors sourceBirth targetBirth Families source target) env ↔
44
+ LinkedProfilePreservingTransitionRawCode M (env K) (env Labels) (env C) (env D) (env rD)
45
+ (env N) (env sourceCode) (env targetCode) (env z) (env points) (env actors)
46
+ (env sourceBirth) (env targetBirth) (env Families)
47
+ (fun j => env (source j)) (fun j => env (target j)) :=
48
+ (M.realize_linkedMainTransitionRawFormula pairing unions powers separation collection
49
+ K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth source target
50
+ env members omega ordinal).and
51
+ ((M.realize_relativePowerFormula (source 0) Families env members).and
52
+ (BoundedFormula.realize_oldProfilePreservationFormula M (source 0) (source 1) (source 2)
53
+ (target 0) (target 1) (target 2) points Families env members))
54
+
55
+ end TransitiveGround
56
+
57
+ namespace LinkedProfilePreservingTransitionRawCode
58
+ variable {M : TransitiveGround.{u}}
59
+ variable {K Labels C D rD N sourceCode targetCode z points actors sourceBirth targetBirth Families : ZFSet.{u}}
60
+ variable {source target : Fin 24 → ZFSet.{u}}
61
+
62
+ theorem exists_transition
63
+ (raw : LinkedProfilePreservingTransitionRawCode M K Labels C D rD N sourceCode targetCode z
64
+ points actors sourceBirth targetBirth Families source target)
65
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
66
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
67
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
68
+ (sourceGround : ∀ j, source j ∈ M.sets) (targetGround : ∀ j, target j ∈ M.sets)
69
+ (hPoints : points ∈ M.sets) (hActors : actors ∈ M.sets)
70
+ (hC : C ∈ M.sets) (hD : D ∈ M.sets) (hrD : rD ∈ M.sets) (omega : N = ZFSet.omega) :
71
+ LinkedProfilePreservingTransitionCode M K Labels C D rD sourceCode targetCode z := by
72
+ rw [omega] at raw
73
+ obtain ⟨s, t, sourceEqual, targetEqual, transition, equal, covered⟩ :=
74
+ raw.1.exists_transition pairing unions powers separation sourceGround targetGround
75
+ hPoints hActors hC hD hrD rfl
76
+ have sourceCode := s.rawFields_code
77
+ have targetCode := t.rawFields_code
78
+ rw [sourceEqual] at sourceCode
79
+ rw [targetEqual] at targetCode
80
+ have sourceFields := sourceCode.fields_unique raw.1.1
81
+ have targetFields := targetCode.fields_unique raw.1.2.1
82
+ have mapEqual : ZFSet.pair transition.map.points transition.map.actors = ZFSet.pair points actors :=
83
+ equal.trans raw.1.2.2.2.2.1.1
84
+ have pointsEqual := (ZFSet.pair_inj.1 mapEqual).1
85
+ have preservation := raw.2.2
86
+ rw [raw.2.1, ← sourceFields, ← targetFields] at preservation
87
+ refine ⟨s, t, sourceEqual, targetEqual, transition, equal, covered, ?_⟩
88
+ change OldProfilePreservationCode s.main.stage.carrier s.main.stage.order s.main.stage.meetGraph
89
+ t.main.stage.carrier t.main.stage.order t.main.stage.meetGraph
90
+ transition.map.points (M.groundPower s.main.stage.carrier)
91
+ rw [pointsEqual]
92
+ exact preservation
93
+
94
+ end LinkedProfilePreservingTransitionRawCode
95
+
96
+ namespace GroundLinkedMainStage
97
+ variable {M : TransitiveGround.{u}} {K Labels C D rD : ZFSet.{u}}
98
+ variable (source target : GroundLinkedMainStage M K Labels C D rD)
99
+ theorem profileTransition_rawFields
100
+ (transition : GroundChronologicalMainTransition source.main target.main)
101
+ (covered : transition.CoversOldBirths) (preserved : transition.PreservesOldProfiles) :
102
+ LinkedProfilePreservingTransitionRawCode M K Labels C D rD ZFSet.omega source.code target.code
103
+ transition.map.code transition.map.points transition.map.actors source.main.birth target.main.birth
104
+ (M.groundPower source.main.stage.carrier) source.rawFields target.rawFields :=
105
+ ⟨source.transition_rawFields target transition covered, rfl, preserved⟩
106
+
107
+ end GroundLinkedMainStage
108
+
109
+ end PartitionPilot.Forcing
110
+
111
+ end
112
+
113
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/MainLimitCoverageFormulas.lean CHANGED
@@ -1,559 +1,559 @@
1
- import OAI.SetTheory.PartitionPrinciple.Definability.ForcingHistoryOutputFormulas
2
- import OAI.SetTheory.PartitionPrinciple.Forcing.GreedyAntichainTraces
3
- import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitCoverageGraph
4
-
5
- namespace OAI
6
-
7
-
8
- namespace PartitionPilot.Forcing.BoundedFormula
9
- open SetFormula
10
- universe u
11
-
12
- def orderAntichainFormula {n} (Q order A : Fin n) : BoundedFormula n :=
13
- .conj (.allMem A (.mem 0 Q.succ))
14
- (.allMem A (.allMem A.succ (.allMem Q.succ.succ
15
- (imp (.conj (pairMembershipFormula 0 2 order.succ.succ.succ)
16
- (pairMembershipFormula 0 1 order.succ.succ.succ)) (.equal 2 1)))))
17
-
18
- theorem truth_orderAntichainFormula {n} (Q order A : Fin n)
19
- (env : Fin n → ZFSet.{u}) :
20
- Truth (orderAntichainFormula Q order A) env ↔ OrderAntichainCode (env Q) (env order) (env A) := by
21
- simp only [orderAntichainFormula, Truth, truth_imp, truth_pairMembershipFormula]
22
- constructor
23
- · rintro ⟨subset, law⟩
24
- exact ⟨subset, fun p hp q hq r hr first second => law p hp q hq r hr ⟨first, second⟩⟩
25
- · rintro ⟨subset, law⟩
26
- exact ⟨subset, fun p hp q hq r hr both => law p hp q hq r hr both.1 both.2⟩
27
-
28
- def relativeMaximalAntichainFormula {n} (Q order D A : Fin n) : BoundedFormula n :=
29
- .conj (.allMem A (.mem 0 D.succ)) (.conj (orderAntichainFormula Q order A)
30
- (.allMem D (exMem A.succ (exMem Q.succ.succ
31
- (.conj (pairMembershipFormula 0 2 order.succ.succ.succ)
32
- (pairMembershipFormula 0 1 order.succ.succ.succ))))))
33
-
34
- theorem truth_relativeMaximalAntichainFormula {n} (Q order D A : Fin n)
35
- (env : Fin n → ZFSet.{u}) :
36
- Truth (relativeMaximalAntichainFormula Q order D A) env ↔
37
- RelativeMaximalAntichainCode (env Q) (env order) (env D) (env A) := by
38
- simp only [relativeMaximalAntichainFormula, Truth, truth_orderAntichainFormula,
39
- truth_exMem, truth_pairMembershipFormula]
40
- rfl
41
-
42
-
43
-
44
-
45
-
46
- def exGraphFields {n} (f : Fin n) (body : BoundedFormula (n + 2)) : BoundedFormula n :=
47
- exMem f (exPairFields 0
48
- (reindex (Fin.cases 0 (Fin.cases 1 (fun i => i.succ.succ.succ))) body))
49
-
50
- theorem truth_exGraphFields {n} (f : Fin n) (body : BoundedFormula (n + 2))
51
- (env : Fin n → ZFSet.{u}) :
52
- Truth (exGraphFields f body) env ↔
53
- ∃ x y, ZFSet.pair x y ∈ env f ∧ Truth body (extend y (extend x env)) := by
54
- simp only [exGraphFields, truth_exMem, truth_exPairFields, truth_reindex]
55
- have rearrange (z x y : ZFSet.{u}) :
56
- (fun i => extend y (extend x (extend z env))
57
- (Fin.cases 0 (Fin.cases 1 (fun j => j.succ.succ.succ)) i)) =
58
- extend y (extend x env) := by
59
- funext i
60
- refine Fin.cases ?_ (fun j => Fin.cases ?_ (fun k => ?_) j) i <;> rfl
61
- simp only [rearrange]
62
- change (∃ z ∈ env f, ∃ x y, z = ZFSet.pair x y ∧
63
- Truth body (extend y (extend x env))) ↔ _
64
- constructor
65
- · rintro ⟨z, member, x, y, rfl, holds⟩
66
- exact ⟨x, y, member, holds⟩
67
- · rintro ⟨x, y, member, holds⟩
68
- exact ⟨ZFSet.pair x y, member, x, y, rfl, holds⟩
69
-
70
- def exLinkedCoverageFields {n} (z : Fin n) (body : BoundedFormula (n + 3)) : BoundedFormula n :=
71
- exPairFields z (exPairFields 0 (exPairFields 3
72
- (exPairFields 0 (exPairFields 0 (exPairFields 0
73
- (.conj (tupleShapeFormula 6 0)
74
- (reindex (Fin.cases 9 (Fin.cases 1 (Fin.cases 7
75
- (fun i => i.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ)))) body)))))))
76
-
77
- theorem truth_exLinkedCoverageFields {n} (z : Fin n) (body : BoundedFormula (n + 3))
78
- (env : Fin n → ZFSet.{u}) :
79
- Truth (exLinkedCoverageFields z body) env ↔
80
- ∃ P G cutoff, LinkedCoverageFieldsCode (env z) P G cutoff ∧
81
- Truth body (extend cutoff (extend G (extend P env))) := by
82
- simp only [exLinkedCoverageFields, truth_exPairFields, Truth, truth_tupleShapeFormula,
83
- truth_reindex]
84
- have rearrange (s outer cutoff serial P tail r tail' μ tail'' G rest : ZFSet.{u}) :
85
- (fun i => extend rest (extend G (extend tail'' (extend μ (extend tail' (extend r
86
- (extend tail (extend P (extend serial (extend cutoff (extend outer (extend s env)))))))))))
87
- (Fin.cases 9 (Fin.cases 1 (Fin.cases 7
88
- (fun j => j.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ))) i)) =
89
- extend cutoff (extend G (extend P env)) := by
90
- funext i
91
- refine Fin.cases ?_ (fun j => Fin.cases ?_ (fun k => Fin.cases ?_ (fun l => ?_) k) j) i <;> rfl
92
- simp only [rearrange]
93
- change (∃ s outer, env z = ZFSet.pair s outer ∧ ∃ cutoff serial,
94
- outer = ZFSet.pair cutoff serial ∧ ∃ P tail, s = ZFSet.pair P tail ∧
95
- ∃ r tail', tail = ZFSet.pair r tail' ∧ ∃ μ tail'', tail' = ZFSet.pair μ tail'' ∧
96
- ∃ G rest, tail'' = ZFSet.pair G rest ∧
97
- (∃ fields, rest = nonemptyTupleCode 6 fields) ∧
98
- Truth body (extend cutoff (extend G (extend P env)))) ↔ _
99
- constructor
100
- · rintro ⟨s, outer, equal, cutoff, serial, rfl, P, tail, rfl, r, tail', rfl,
101
- μ, tail'', rfl, G, rest, rfl, ⟨fields, rfl⟩, holds⟩
102
- exact ⟨P, G, cutoff, ⟨r, μ, fields 0, fields 1, fields 2, fields 3, fields 4,
103
- fields 5, fields 6, serial, equal⟩, holds⟩
104
- · rintro ⟨P, G, cutoff, ⟨r, μ, m, inv, one, action, bottom, top, height, serial, equal⟩, holds⟩
105
- let fields : Fin 7 → ZFSet.{u} := Fin.cases m (Fin.cases inv (Fin.cases one
106
- (Fin.cases action (Fin.cases bottom (Fin.cases top (fun _ => height))))))
107
- refine ⟨_, _, equal, cutoff, serial, rfl, P, _, rfl, r, _, rfl, μ, _, rfl,
108
- G, nonemptyTupleCode 6 fields, rfl, ⟨fields, rfl⟩, holds⟩
109
-
110
-
111
-
112
-
113
-
114
- def exMainLimitStageFields {n} (T S : Fin n) (body : BoundedFormula (n + 4)) : BoundedFormula n :=
115
- exGraphFields S (.conj (.mem 1 T.succ.succ)
116
- (exLinkedCoverageFields 0 (reindex
117
- (Fin.cases 0 (Fin.cases 1 (Fin.cases 2 (Fin.cases 4
118
- (fun i => i.succ.succ.succ.succ.succ))))) body)))
119
-
120
- theorem truth_exMainLimitStageFields {n} (T S : Fin n) (body : BoundedFormula (n + 4))
121
- (env : Fin n → ZFSet.{u}) :
122
- Truth (exMainLimitStageFields T S body) env ↔
123
- ∃ i z P G t, i ∈ env T ∧ ZFSet.pair i z ∈ env S ∧
124
- LinkedCoverageFieldsCode z P G t ∧ Truth body (extend t (extend G (extend P (extend i env)))) := by
125
- simp only [exMainLimitStageFields, truth_exGraphFields, Truth, truth_exLinkedCoverageFields,
126
- truth_reindex]
127
- have rearrange (i z P G t : ZFSet.{u}) :
128
- (fun j => extend t (extend G (extend P (extend z (extend i env))))
129
- (Fin.cases 0 (Fin.cases 1 (Fin.cases 2 (Fin.cases 4
130
- (fun k => k.succ.succ.succ.succ.succ)))) j)) =
131
- extend t (extend G (extend P (extend i env))) := by
132
- funext j
133
- refine Fin.cases ?_ (fun k => Fin.cases ?_ (fun l => Fin.cases ?_
134
- (fun m => Fin.cases ?_ (fun a => ?_) m) l) k) j <;> rfl
135
- simp only [rearrange]
136
- change (∃ i z, ZFSet.pair i z ∈ env S ∧ i ∈ env T ∧ ∃ P G t,
137
- LinkedCoverageFieldsCode z P G t ∧ Truth body (extend t (extend G (extend P (extend i env))))) ↔ _
138
- constructor
139
- · rintro ⟨i,z,entry,member,P,G,t,shape,holds⟩
140
- exact ⟨i,z,P,G,t,member,entry,shape,holds⟩
141
- · rintro ⟨i,z,P,G,t,member,entry,shape,holds⟩
142
- exact ⟨i,z,entry,member,P,G,t,shape,holds⟩
143
-
144
- def exMainLimitConeFields {n} (T S row : Fin n) (body : BoundedFormula (n + 6)) : BoundedFormula n :=
145
- exMainLimitStageFields T S (exGraphFields row.succ.succ.succ.succ
146
- (.conj (orderedPairFormula 1 T.succ.succ.succ.succ.succ.succ 5)
147
- (exPairFields 0 (reindex (Fin.cases 0 (Fin.cases 1 (Fin.cases 4 (Fin.cases 5
148
- (Fin.cases 6 (Fin.cases 7 (fun i => i.succ.succ.succ.succ.succ.succ.succ.succ))))))) body))))
149
-
150
- theorem truth_exMainLimitConeFields {n} (T S row : Fin n) (body : BoundedFormula (n + 6))
151
- (env : Fin n → ZFSet.{u}) :
152
- Truth (exMainLimitConeFields T S row body) env ↔
153
- ∃ i P G t points actors, MainLimitConeEntryCode (env T) (env S) (env row) i P G t points actors ∧
154
- Truth body (extend actors (extend points (extend t (extend G (extend P (extend i env)))))) := by
155
- simp only [exMainLimitConeFields, truth_exMainLimitStageFields, truth_exGraphFields, Truth,
156
- truth_orderedPairFormula, truth_exPairFields, truth_reindex]
157
- have rearrange (i P G t key value points actors : ZFSet.{u}) :
158
- (fun j => extend actors (extend points (extend value (extend key (extend t
159
- (extend G (extend P (extend i env)))))))
160
- (Fin.cases 0 (Fin.cases 1 (Fin.cases 4 (Fin.cases 5 (Fin.cases 6
161
- (Fin.cases 7 (fun k => k.succ.succ.succ.succ.succ.succ.succ.succ)))))) j)) =
162
- extend actors (extend points (extend t (extend G (extend P (extend i env))))) := by
163
- funext j
164
- refine Fin.cases ?_ (fun a => Fin.cases ?_ (fun b => Fin.cases ?_ (fun c =>
165
- Fin.cases ?_ (fun d => Fin.cases ?_ (fun e => Fin.cases ?_ (fun f => ?_) e) d) c) b) a) j <;> rfl
166
- simp only [rearrange]
167
- change (∃ i z P G t, i ∈ env T ∧ ZFSet.pair i z ∈ env S ∧ LinkedCoverageFieldsCode z P G t ∧
168
- ∃ key value, ZFSet.pair key value ∈ env row ∧ key = ZFSet.pair (env T) i ∧
169
- ∃ points actors, value = ZFSet.pair points actors ∧
170
- Truth body (extend actors (extend points (extend t (extend G (extend P (extend i env))))))) ↔ _
171
- constructor
172
- · rintro ⟨i,z,P,G,t,member,entry,shape,key,value,rowEntry,rfl,points,actors,rfl,holds⟩
173
- exact ⟨i,P,G,t,points,actors,⟨member,z,entry,shape,rowEntry⟩,holds⟩
174
- · rintro ⟨i,P,G,t,points,actors,⟨member,z,entry,shape,rowEntry⟩,holds⟩
175
- exact ⟨i,z,P,G,t,member,entry,shape,_,_,rowEntry,rfl,points,actors,rfl,holds⟩
176
-
177
-
178
-
179
-
180
-
181
- def certificateGraphEntryAt {n} (j F B f k : Fin n) : BoundedFormula n :=
182
- exGraphFields k (.conj (.equal 1 j.succ.succ)
183
- (exPairFields 0 (.conj (.equal 1 F.succ.succ.succ.succ)
184
- (orderedPairFormula 0 B.succ.succ.succ.succ f.succ.succ.succ.succ))))
185
-
186
- theorem truth_certificateGraphEntryAt {n} (j F B f k : Fin n)
187
- (env : Fin n → ZFSet.{u}) :
188
- Truth (certificateGraphEntryAt j F B f k) env ↔
189
- ZFSet.pair (env j) (ZFSet.pair (env F) (ZFSet.pair (env B) (env f))) ∈ env k := by
190
- simp only [certificateGraphEntryAt, truth_exGraphFields, Truth,
191
- truth_exPairFields, truth_orderedPairFormula]
192
- change (∃ key certificate, ZFSet.pair key certificate ∈ env k ∧ key = env j ∧
193
- ∃ profile tail, certificate = ZFSet.pair profile tail ∧ profile = env F ∧
194
- tail = ZFSet.pair (env B) (env f)) ↔ _
195
- constructor
196
- · rintro ⟨key, certificate, entry, rfl, profile, tail, rfl, rfl, rfl⟩
197
- exact entry
198
- · intro entry
199
- exact ⟨env j, _, entry, rfl, env F, _, rfl, rfl, rfl⟩
200
-
201
- def enumerationGraphEntryAt {n} (j e names g : Fin n) : BoundedFormula n :=
202
- exGraphFields g (.conj (.equal 1 j.succ.succ)
203
- (orderedPairFormula 0 e.succ.succ names.succ.succ))
204
-
205
- theorem truth_enumerationGraphEntryAt {n} (j e names g : Fin n)
206
- (env : Fin n → ZFSet.{u}) :
207
- Truth (enumerationGraphEntryAt j e names g) env ↔
208
- ZFSet.pair (env j) (ZFSet.pair (env e) (env names)) ∈ env g := by
209
- simp only [enumerationGraphEntryAt, truth_exGraphFields, Truth, truth_orderedPairFormula]
210
- change (∃ key pair, ZFSet.pair key pair ∈ env g ∧ key = env j ∧
211
- pair = ZFSet.pair (env e) (env names)) ↔ _
212
- constructor
213
- · rintro ⟨key, pair, entry, rfl, rfl⟩
214
- exact entry
215
- · intro entry
216
- exact ⟨env j, _, entry, rfl, rfl⟩
217
-
218
-
219
-
220
-
221
-
222
- def relativeAntichainFamilyFormula {n} (j A Q order domains : Fin n) : BoundedFormula n :=
223
- exGraphFields domains (.conj (.equal 1 j.succ.succ)
224
- (relativeMaximalAntichainFormula Q.succ.succ order.succ.succ 0 A.succ.succ))
225
-
226
- theorem truth_relativeAntichainFamilyFormula {n} (j A Q order domains : Fin n)
227
- (env : Fin n → ZFSet.{u}) :
228
- Truth (relativeAntichainFamilyFormula j A Q order domains) env ↔
229
- ∃ D, ZFSet.pair (env j) D ∈ env domains ∧
230
- RelativeMaximalAntichainCode (env Q) (env order) D (env A) := by
231
- simp only [relativeAntichainFamilyFormula, truth_exGraphFields, Truth,
232
- truth_relativeMaximalAntichainFormula]
233
- change (∃ key D, ZFSet.pair key D ∈ env domains ∧ key = env j ∧
234
- RelativeMaximalAntichainCode (env Q) (env order) D (env A)) ↔ _
235
- constructor
236
- · rintro ⟨key, D, entry, rfl, code⟩
237
- exact ⟨D, entry, code⟩
238
- · rintro ⟨D, entry, code⟩
239
- exact ⟨env j, D, entry, rfl, code⟩
240
-
241
-
242
-
243
-
244
-
245
- def assignmentQueryWithinFormula {n} (X T q : Fin n) : BoundedFormula n :=
246
- exPairFields q (stageOneAssignmentsSubsetFormula 0 X.succ.succ T.succ.succ)
247
-
248
- theorem truth_assignmentQueryWithinFormula {n} (X T q : Fin n)
249
- (env : Fin n → ZFSet.{u}) :
250
- Truth (assignmentQueryWithinFormula X T q) env ↔
251
- AssignmentQueryWithin (env X) (env T) (env q) := by
252
- simp only [assignmentQueryWithinFormula, truth_exPairFields,
253
- truth_stageOneAssignmentsSubsetFormula]
254
- rfl
255
-
256
- def representativeIndexAdditionsMemberFormula {n} (i I T Q c X : Fin n) : BoundedFormula n :=
257
- .conj (.mem i I) (exMem Q
258
- (.conj (assignmentQueryWithinFormula X.succ T.succ 0)
259
- (exGraphFields c.succ (.conj (.equal 1 2)
260
- (exPairFields 0
261
- (exMem T.succ.succ.succ.succ.succ
262
- (exMem T.succ.succ.succ.succ.succ.succ
263
- (exMem 2 (stageOneAssignmentFormula 0
264
- i.succ.succ.succ.succ.succ.succ.succ.succ 2 1)))))))))
265
-
266
- theorem truth_representativeIndexAdditionsMemberFormula {n} (i I T Q c X : Fin n)
267
- (env : Fin n → ZFSet.{u}) :
268
- Truth (representativeIndexAdditionsMemberFormula i I T Q c X) env ↔
269
- env i ∈ representativeIndexAdditions (env I) (env T) (env Q) (env c) (env X) := by
270
- simp only [representativeIndexAdditionsMemberFormula, Truth, truth_exMem,
271
- truth_assignmentQueryWithinFormula, truth_exGraphFields, truth_exPairFields,
272
- truth_stageOneAssignmentFormula]
273
- rw [mem_representativeIndexAdditions]
274
- change (env i ∈ env I ∧ ∃ q ∈ env Q, AssignmentQueryWithin (env X) (env T) q ∧
275
- ∃ key value, ZFSet.pair key value ∈ env c ∧ key = q ∧
276
- ∃ row A, value = ZFSet.pair row A ∧ ∃ v ∈ env T, ∃ w ∈ env T,
277
- ∃ z ∈ A, z = stageOneAssignment (env i) v w) ↔ _
278
- apply and_congr Iff.rfl
279
- constructor
280
- · rintro ⟨q, hq, localQuery, key, value, entry, rfl, row, A, rfl, v, hv, w, hw, z, hz, rfl⟩
281
- exact ⟨key, hq, localQuery, row, A, entry, v, hv, w, hw, hz⟩
282
- · rintro ⟨q, hq, localQuery, row, A, entry, v, hv, w, hw, hz⟩
283
- exact ⟨q, hq, localQuery, q, ZFSet.pair row A, entry, rfl, row, A, rfl,
284
- v, hv, w, hw, stageOneAssignment (env i) v w, hz, rfl⟩
285
-
286
-
287
-
288
-
289
-
290
- def supportedCertificateFormula {n}
291
- (nodes N order R niceEval visibilityEval value F B f : Fin n) : BoundedFormula n :=
292
- .conj (.allMem F (.mem 0 nodes.succ))
293
- (.conj (.allMem B (.mem 0 F.succ))
294
- (.conj (.allMem F (exMem B.succ (pairMembershipFormula 0 1 order.succ.succ)))
295
- (.conj (functionFormula B N f)
296
- (.conj
297
- (.neg (exGraphFields visibilityEval
298
- (.conj (.mem 1 nodes.succ.succ)
299
- (.neg (.conj (imp (.mem value.succ.succ 0) (.mem 1 F.succ.succ))
300
- (imp (.mem 1 F.succ.succ) (.mem value.succ.succ 0)))))))
301
- (.allMem B (.allMem N.succ
302
- (imp (pairMembershipFormula 1 0 f.succ.succ)
303
- (.conj (pairMembershipFormula 1 0 R.succ.succ)
304
- (pairMembershipFormula 0 value.succ.succ niceEval.succ.succ)))))))))
305
-
306
- theorem truth_supportedCertificateFormula {n}
307
- (nodes N order R niceEval visibilityEval value F B f : Fin n)
308
- (env : Fin n → ZFSet.{u}) :
309
- Truth (supportedCertificateFormula nodes N order R niceEval visibilityEval value F B f) env ↔
310
- SupportedEqualityCertificate (env nodes) (env N) (env order) (env R)
311
- (env niceEval) (env visibilityEval) (env value) (env F) (env B) (env f) := by
312
- classical
313
- simp only [supportedCertificateFormula, Truth, truth_exMem, truth_pairMembershipFormula,
314
- truth_functionFormula, truth_exGraphFields, truth_imp, not_exists, not_and, not_not,
315
- ← iff_def]
316
- rfl
317
-
318
- def supportedCertificateEntryFormula {n}
319
- (entry J PF PB WF nodes N order R inputEval niceEval visibilityEval : Fin n) :
320
- BoundedFormula n :=
321
- exPairFields entry (exPairFields 0 (exPairFields 0
322
- (.conj (.mem 5 J.succ.succ.succ.succ.succ.succ)
323
- (.conj (.mem 3 PF.succ.succ.succ.succ.succ.succ)
324
- (.conj (.mem 1 PB.succ.succ.succ.succ.succ.succ)
325
- (.conj (.mem 0 WF.succ.succ.succ.succ.succ.succ)
326
- (exGraphFields inputEval.succ.succ.succ.succ.succ.succ
327
- (.conj (.equal 1 7)
328
- (supportedCertificateFormula
329
- nodes.succ.succ.succ.succ.succ.succ.succ.succ
330
- N.succ.succ.succ.succ.succ.succ.succ.succ
331
- order.succ.succ.succ.succ.succ.succ.succ.succ
332
- R.succ.succ.succ.succ.succ.succ.succ.succ
333
- niceEval.succ.succ.succ.succ.succ.succ.succ.succ
334
- visibilityEval.succ.succ.succ.succ.succ.succ.succ.succ
335
- 0 5 3 2)))))))))
336
-
337
- theorem truth_supportedCertificateEntryFormula {n}
338
- (entry J PF PB WF nodes N order R inputEval niceEval visibilityEval : Fin n)
339
- (env : Fin n → ZFSet.{u}) :
340
- Truth (supportedCertificateEntryFormula entry J PF PB WF nodes N order R
341
- inputEval niceEval visibilityEval) env ↔
342
- ∃ j ∈ env J, ∃ F ∈ env PF, ∃ B ∈ env PB, ∃ f ∈ env WF,
343
- env entry = ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∧
344
- ∃ value, ZFSet.pair j value ∈ env inputEval ∧
345
- SupportedEqualityCertificate (env nodes) (env N) (env order) (env R)
346
- (env niceEval) (env visibilityEval) value F B f := by
347
- simp only [supportedCertificateEntryFormula, truth_exPairFields, Truth,
348
- truth_exGraphFields, truth_supportedCertificateFormula]
349
- change (∃ j tail, env entry = ZFSet.pair j tail ∧
350
- ∃ F rest, tail = ZFSet.pair F rest ∧
351
- ∃ B f, rest = ZFSet.pair B f ∧
352
- j ∈ env J ∧ F ∈ env PF ∧ B ∈ env PB ∧ f ∈ env WF ∧
353
- ∃ j' value, ZFSet.pair j' value ∈ env inputEval ∧ j' = j ∧
354
- SupportedEqualityCertificate (env nodes) (env N) (env order) (env R)
355
- (env niceEval) (env visibilityEval) value F B f) ↔ _
356
- constructor
357
- · rintro ⟨j, tail, equal, F, rest, rfl, B, f, rfl, hj, hF, hB, hf,
358
- j', value, evaluated, rfl, certificate⟩
359
- exact ⟨j', hj, F, hF, B, hB, f, hf, equal, value, evaluated, certificate⟩
360
- · rintro ⟨j, hj, F, hF, B, hB, f, hf, equal, value, evaluated, certificate⟩
361
- exact ⟨j, _, equal, F, _, rfl, B, f, rfl, hj, hF, hB, hf,
362
- j, value, evaluated, rfl, certificate⟩
363
-
364
-
365
-
366
-
367
-
368
- def exMainLimitImageFields {n} (actor : Bool) (T S row : Fin n)
369
- (body : BoundedFormula (n + 1)) : BoundedFormula n :=
370
- exMainLimitConeFields T S row (exGraphFields (if actor then 0 else 1)
371
- (.conj (.mem 1 (if actor then 5 else 6))
372
- (reindex (Fin.cases 0 (fun i => i.succ.succ.succ.succ.succ.succ.succ.succ)) body)))
373
-
374
- theorem truth_exMainLimitImageFields {n} (actor : Bool) (T S row : Fin n)
375
- (body : BoundedFormula (n + 1)) (env : Fin n → ZFSet.{u}) :
376
- Truth (exMainLimitImageFields actor T S row body) env ↔
377
- ∃ x, (if actor then MainLimitOldActorImageCode (env T) (env S) (env row) x
378
- else MainLimitOldPointImageCode (env T) (env S) (env row) x) ∧ Truth body (extend x env) := by
379
- simp only [exMainLimitImageFields, truth_exMainLimitConeFields, truth_exGraphFields, Truth, truth_reindex]
380
- have rearrange (i P G t points actors y x : ZFSet.{u}) :
381
- (fun j => extend x (extend y (extend actors (extend points (extend t
382
- (extend G (extend P (extend i env)))))))
383
- (Fin.cases 0 (fun k => k.succ.succ.succ.succ.succ.succ.succ.succ) j)) = extend x env := by
384
- funext j
385
- refine Fin.cases ?_ (fun k => ?_) j <;> rfl
386
- simp only [rearrange]
387
- cases actor <;> simp only [Bool.false_eq_true, ite_false, ite_true]
388
- · change (∃ i P G t points actors, MainLimitConeEntryCode (env T) (env S) (env row) i P G t points actors ∧
389
- ∃ y x, ZFSet.pair y x ∈ points ∧ y ∈ P ∧ Truth body (extend x env)) ↔ _
390
- constructor
391
- · rintro ⟨i,P,G,t,points,actors,entry,y,x,image,member,holds⟩
392
- exact ⟨x,⟨i,P,G,t,points,actors,y,entry,member,image⟩,holds⟩
393
- · rintro ⟨x,⟨i,P,G,t,points,actors,y,entry,member,image⟩,holds⟩
394
- exact ⟨i,P,G,t,points,actors,entry,y,x,image,member,holds⟩
395
- · change (∃ i P G t points actors, MainLimitConeEntryCode (env T) (env S) (env row) i P G t points actors ∧
396
- ∃ y x, ZFSet.pair y x ∈ actors ∧ y ∈ G ∧ Truth body (extend x env)) ↔ _
397
- constructor
398
- · rintro ⟨i,P,G,t,points,actors,entry,y,x,image,member,holds⟩
399
- exact ⟨x,⟨i,P,G,t,points,actors,y,entry,member,image⟩,holds⟩
400
- · rintro ⟨x,⟨i,P,G,t,points,actors,y,entry,member,image⟩,holds⟩
401
- exact ⟨i,P,G,t,points,actors,entry,y,x,image,member,holds⟩
402
-
403
- def mainLimitImageFormula {n} (actor : Bool) (T S row x : Fin n) : BoundedFormula n :=
404
- exMainLimitImageFields actor T S row (.equal 0 x.succ)
405
-
406
- theorem truth_mainLimitImageFormula {n} (actor : Bool) (T S row x : Fin n)
407
- (env : Fin n → ZFSet.{u}) : Truth (mainLimitImageFormula actor T S row x) env ↔
408
- (if actor then MainLimitOldActorImageCode (env T) (env S) (env row) (env x)
409
- else MainLimitOldPointImageCode (env T) (env S) (env row) (env x)) := by
410
- rw [mainLimitImageFormula, truth_exMainLimitImageFields]
411
- change (∃ y, _ ∧ y = env x) ↔ _
412
- constructor
413
- · rintro ⟨y, member, rfl⟩
414
- exact member
415
- · exact fun member => ⟨env x, member, rfl⟩
416
-
417
- def mainLimitOldCutoffFormula {n} (T S t : Fin n) : BoundedFormula n :=
418
- exMainLimitStageFields T S (disj (.equal t.succ.succ.succ.succ 0)
419
- (.mem t.succ.succ.succ.succ 0))
420
-
421
- theorem truth_mainLimitOldCutoffFormula {n} (T S t : Fin n) (env : Fin n → ZFSet.{u}) :
422
- Truth (mainLimitOldCutoffFormula T S t) env ↔ MainLimitOldCutoffCode (env T) (env S) (env t) := by
423
- simp only [mainLimitOldCutoffFormula, truth_exMainLimitStageFields, truth_disj, Truth]
424
- change (∃ i z P G cutoff, i ∈ env T ∧ ZFSet.pair i z ∈ env S ∧
425
- LinkedCoverageFieldsCode z P G cutoff ∧ (env t = cutoff ∨ env t ∈ cutoff)) ↔ _
426
- constructor
427
- · rintro ⟨i,z,P,G,cutoff,member,entry,shape,bound⟩
428
- exact ⟨i,member,z,entry,P,G,cutoff,shape,bound⟩
429
- · rintro ⟨i,member,z,entry,P,G,cutoff,shape,bound⟩
430
- exact ⟨i,z,P,G,cutoff,member,entry,shape,bound⟩
431
-
432
-
433
-
434
-
435
-
436
- def mainLimitPointCoverageFormula {n} (T S row Q top : Fin n) : BoundedFormula n :=
437
- .conj (.allMem Q (imp (.neg (.equal 0 top.succ))
438
- (mainLimitImageFormula false T.succ S.succ row.succ 0)))
439
- (.neg (exMainLimitImageFields false T S row
440
- (.neg (.conj (.mem 0 Q.succ) (.neg (.equal 0 top.succ))))))
441
-
442
- theorem truth_mainLimitPointCoverageFormula {n} (T S row Q top : Fin n)
443
- (env : Fin n → ZFSet.{u}) : Truth (mainLimitPointCoverageFormula T S row Q top) env ↔
444
- ∀ x, (x ∈ env Q ∧ x ≠ env top) ↔ MainLimitOldPointImageCode (env T) (env S) (env row) x := by
445
- classical
446
- simp only [mainLimitPointCoverageFormula, Truth, truth_imp, truth_mainLimitImageFormula,
447
- truth_exMainLimitImageFields, Bool.false_eq_true, ite_false, not_exists, not_and, not_not, Classical.not_imp]
448
- change ((∀ x ∈ env Q, x ≠ env top → MainLimitOldPointImageCode (env T) (env S) (env row) x) ∧
449
- ∀ x, MainLimitOldPointImageCode (env T) (env S) (env row) x → x ∈ env Q ∧ x ≠ env top) ↔ _
450
- constructor
451
- · rintro ⟨forward, reverse⟩ x
452
- exact ⟨fun h => forward x h.1 h.2, reverse x⟩
453
- · intro laws
454
- exact ⟨fun x member different => (laws x).1 ⟨member,different⟩, fun x => (laws x).2⟩
455
-
456
- def mainLimitActorCoverageFormula {n} (T S row H : Fin n) : BoundedFormula n :=
457
- .conj (.allMem H (mainLimitImageFormula true T.succ S.succ row.succ 0))
458
- (.neg (exMainLimitImageFields true T S row (.neg (.mem 0 H.succ))))
459
-
460
- theorem truth_mainLimitActorCoverageFormula {n} (T S row H : Fin n)
461
- (env : Fin n → ZFSet.{u}) : Truth (mainLimitActorCoverageFormula T S row H) env ↔
462
- ∀ g, g ∈ env H ↔ MainLimitOldActorImageCode (env T) (env S) (env row) g := by
463
- classical
464
- simp only [mainLimitActorCoverageFormula, Truth, truth_mainLimitImageFormula,
465
- truth_exMainLimitImageFields, ite_true, not_exists, not_and, not_not]
466
- change ((∀ g ∈ env H, MainLimitOldActorImageCode (env T) (env S) (env row) g) ∧
467
- ∀ g, MainLimitOldActorImageCode (env T) (env S) (env row) g → g ∈ env H) ↔ _
468
- exact ⟨fun h g => ⟨h.1 g,h.2 g⟩, fun h => ⟨fun g => (h g).1,fun g => (h g).2⟩⟩
469
-
470
- def mainLimitStrictTopFormula {n} (T S row R top : Fin n) : BoundedFormula n :=
471
- .neg (exMainLimitConeFields T S row (exGraphFields 1 (.neg
472
- (.conj (pairMembershipFormula 0 top.succ.succ.succ.succ.succ.succ.succ.succ
473
- R.succ.succ.succ.succ.succ.succ.succ.succ)
474
- (.neg (pairMembershipFormula top.succ.succ.succ.succ.succ.succ.succ.succ 0
475
- R.succ.succ.succ.succ.succ.succ.succ.succ))))))
476
-
477
- theorem truth_mainLimitStrictTopFormula {n} (T S row R top : Fin n)
478
- (env : Fin n → ZFSet.{u}) : Truth (mainLimitStrictTopFormula T S row R top) env ↔
479
- ∀ i P G t points actors, MainLimitConeEntryCode (env T) (env S) (env row) i P G t points actors →
480
- ∀ x y, ZFSet.pair x y ∈ points → ZFSet.pair y (env top) ∈ env R ∧
481
- ZFSet.pair (env top) y ∉ env R := by
482
- classical
483
- simp only [mainLimitStrictTopFormula, Truth, truth_exMainLimitConeFields,
484
- truth_exGraphFields, truth_pairMembershipFormula, not_exists, not_and, not_not, Classical.not_imp]
485
- rfl
486
-
487
- def mainLimitCutoffFormula {n} (T S cutoff : Fin n) : BoundedFormula n :=
488
- .conj (.allMem cutoff (mainLimitOldCutoffFormula T.succ S.succ 0))
489
- (.neg (exMainLimitStageFields T S (.neg
490
- (.conj (.mem 0 cutoff.succ.succ.succ.succ)
491
- (.allMem 0 (.mem 0 cutoff.succ.succ.succ.succ.succ))))))
492
-
493
- theorem truth_mainLimitCutoffFormula {n} (T S cutoff : Fin n) (env : Fin n → ZFSet.{u}) :
494
- Truth (mainLimitCutoffFormula T S cutoff) env ↔
495
- ∀ t, t ∈ env cutoff ↔ MainLimitOldCutoffCode (env T) (env S) t := by
496
- classical
497
- simp only [mainLimitCutoffFormula, Truth, truth_mainLimitOldCutoffFormula,
498
- truth_exMainLimitStageFields, not_exists, not_and, not_not, Classical.not_imp]
499
- change ((∀ t ∈ env cutoff, MainLimitOldCutoffCode (env T) (env S) t) ∧
500
- ∀ i z P G t, i ∈ env T → ZFSet.pair i z ∈ env S → LinkedCoverageFieldsCode z P G t →
501
- t ∈ env cutoff ∧ ∀ s ∈ t, s ∈ env cutoff) ↔ _
502
- constructor
503
- · rintro ⟨forward,bound⟩ t
504
- refine ⟨forward t, ?_⟩
505
- rintro ⟨i,member,z,entry,P,G,s,shape,equal | lower⟩
506
- · exact equal.symm ▸ (bound i z P G s member entry shape).1
507
- · exact (bound i z P G s member entry shape).2 t lower
508
- · intro laws
509
- refine ⟨fun t => (laws t).1, ?_⟩
510
- intro i z P G t member entry shape
511
- exact ⟨(laws t).2 ⟨i,member,z,entry,P,G,t,shape,Or.inl rfl⟩,
512
- fun s lower => (laws s).2 ⟨i,member,z,entry,P,G,t,shape,Or.inr lower⟩⟩
513
-
514
- def mainLimitTopBirthFormula {n} (top cutoff birth : Fin n) : BoundedFormula n :=
515
- .conj (pairMembershipFormula top cutoff birth)
516
- (.neg (exGraphFields birth (.conj (.equal 0 cutoff.succ.succ)
517
- (.neg (.equal 1 top.succ.succ)))))
518
-
519
- theorem truth_mainLimitTopBirthFormula {n} (top cutoff birth : Fin n)
520
- (env : Fin n → ZFSet.{u}) : Truth (mainLimitTopBirthFormula top cutoff birth) env ↔
521
- ∀ x, ZFSet.pair x (env cutoff) ∈ env birth ↔ x = env top := by
522
- classical
523
- simp only [mainLimitTopBirthFormula, Truth, truth_pairMembershipFormula,
524
- truth_exGraphFields, not_exists, not_and, not_not]
525
- change (ZFSet.pair (env top) (env cutoff) ∈ env birth ∧
526
- ∀ x t, ZFSet.pair x t ∈ env birth → t = env cutoff → x = env top) ↔ _
527
- constructor
528
- · rintro ⟨entry,unique⟩ x
529
- exact ⟨fun image => unique x (env cutoff) image rfl, fun equal => equal.symm ▸ entry⟩
530
- · intro laws
531
- exact ⟨(laws (env top)).2 rfl, fun x t image equal => (laws x).1 (equal ▸ image)⟩
532
-
533
- def mainLimitCoverageFormula {n} (T S row Q H R top cutoff birth : Fin n) : BoundedFormula n :=
534
- .conj (mainLimitPointCoverageFormula T S row Q top)
535
- (.conj (mainLimitActorCoverageFormula T S row H)
536
- (.conj (mainLimitStrictTopFormula T S row R top)
537
- (.conj (mainLimitCutoffFormula T S cutoff) (mainLimitTopBirthFormula top cutoff birth))))
538
-
539
- theorem truth_mainLimitCoverageFormula {n} (T S row Q H R top cutoff birth : Fin n)
540
- (env : Fin n → ZFSet.{u}) : Truth (mainLimitCoverageFormula T S row Q H R top cutoff birth) env ↔
541
- MainLimitCoverageGraphCode (env T) (env S) (env row) (env Q) (env H) (env R)
542
- (env top) (env cutoff) (env birth) := by
543
- simp only [mainLimitCoverageFormula, Truth, truth_mainLimitPointCoverageFormula,
544
- truth_mainLimitActorCoverageFormula, truth_mainLimitStrictTopFormula,
545
- truth_mainLimitCutoffFormula, truth_mainLimitTopBirthFormula]
546
- exact ⟨fun h => ⟨h.1,h.2.1,h.2.2.1,h.2.2.2.1,h.2.2.2.2⟩,
547
- fun h => ⟨h.points,h.actors,h.strict_top,h.cutoff_mem,h.top_birth⟩⟩
548
-
549
- theorem realize_mainLimitCoverageFormula (M : TransitiveGround.{u}) {n}
550
- (T S row Q H R top cutoff birth : Fin n) (env : Fin n → ZFSet.{u})
551
- (members : ∀ i, env i ∈ M.sets) :
552
- Realize M.sets (mainLimitCoverageFormula T S row Q H R top cutoff birth).toFormula env ↔
553
- MainLimitCoverageGraphCode (env T) (env S) (env row) (env Q) (env H) (env R)
554
- (env top) (env cutoff) (env birth) :=
555
- (realize_toFormula M _ env members).trans (truth_mainLimitCoverageFormula T S row Q H R top cutoff birth env)
556
-
557
- end PartitionPilot.Forcing.BoundedFormula
558
-
559
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Definability.ForcingHistoryOutputFormulas
2
+ import OAI.SetTheory.PartitionPrinciple.Forcing.GreedyAntichainTraces
3
+ import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundMainPrefixLimitCoverageGraph
4
+
5
+ namespace OAI
6
+
7
+
8
+ namespace PartitionPilot.Forcing.BoundedFormula
9
+ open SetFormula
10
+ universe u
11
+
12
+ def orderAntichainFormula {n} (Q order A : Fin n) : BoundedFormula n :=
13
+ .conj (.allMem A (.mem 0 Q.succ))
14
+ (.allMem A (.allMem A.succ (.allMem Q.succ.succ
15
+ (imp (.conj (pairMembershipFormula 0 2 order.succ.succ.succ)
16
+ (pairMembershipFormula 0 1 order.succ.succ.succ)) (.equal 2 1)))))
17
+
18
+ theorem truth_orderAntichainFormula {n} (Q order A : Fin n)
19
+ (env : Fin n → ZFSet.{u}) :
20
+ Truth (orderAntichainFormula Q order A) env ↔ OrderAntichainCode (env Q) (env order) (env A) := by
21
+ simp only [orderAntichainFormula, Truth, truth_imp, truth_pairMembershipFormula]
22
+ constructor
23
+ · rintro ⟨subset, law⟩
24
+ exact ⟨subset, fun p hp q hq r hr first second => law p hp q hq r hr ⟨first, second⟩⟩
25
+ · rintro ⟨subset, law⟩
26
+ exact ⟨subset, fun p hp q hq r hr both => law p hp q hq r hr both.1 both.2⟩
27
+
28
+ def relativeMaximalAntichainFormula {n} (Q order D A : Fin n) : BoundedFormula n :=
29
+ .conj (.allMem A (.mem 0 D.succ)) (.conj (orderAntichainFormula Q order A)
30
+ (.allMem D (exMem A.succ (exMem Q.succ.succ
31
+ (.conj (pairMembershipFormula 0 2 order.succ.succ.succ)
32
+ (pairMembershipFormula 0 1 order.succ.succ.succ))))))
33
+
34
+ theorem truth_relativeMaximalAntichainFormula {n} (Q order D A : Fin n)
35
+ (env : Fin n → ZFSet.{u}) :
36
+ Truth (relativeMaximalAntichainFormula Q order D A) env ↔
37
+ RelativeMaximalAntichainCode (env Q) (env order) (env D) (env A) := by
38
+ simp only [relativeMaximalAntichainFormula, Truth, truth_orderAntichainFormula,
39
+ truth_exMem, truth_pairMembershipFormula]
40
+ rfl
41
+
42
+
43
+
44
+
45
+
46
+ def exGraphFields {n} (f : Fin n) (body : BoundedFormula (n + 2)) : BoundedFormula n :=
47
+ exMem f (exPairFields 0
48
+ (reindex (Fin.cases 0 (Fin.cases 1 (fun i => i.succ.succ.succ))) body))
49
+
50
+ theorem truth_exGraphFields {n} (f : Fin n) (body : BoundedFormula (n + 2))
51
+ (env : Fin n → ZFSet.{u}) :
52
+ Truth (exGraphFields f body) env ↔
53
+ ∃ x y, ZFSet.pair x y ∈ env f ∧ Truth body (extend y (extend x env)) := by
54
+ simp only [exGraphFields, truth_exMem, truth_exPairFields, truth_reindex]
55
+ have rearrange (z x y : ZFSet.{u}) :
56
+ (fun i => extend y (extend x (extend z env))
57
+ (Fin.cases 0 (Fin.cases 1 (fun j => j.succ.succ.succ)) i)) =
58
+ extend y (extend x env) := by
59
+ funext i
60
+ refine Fin.cases ?_ (fun j => Fin.cases ?_ (fun k => ?_) j) i <;> rfl
61
+ simp only [rearrange]
62
+ change (∃ z ∈ env f, ∃ x y, z = ZFSet.pair x y ∧
63
+ Truth body (extend y (extend x env))) ↔ _
64
+ constructor
65
+ · rintro ⟨z, member, x, y, rfl, holds⟩
66
+ exact ⟨x, y, member, holds⟩
67
+ · rintro ⟨x, y, member, holds⟩
68
+ exact ⟨ZFSet.pair x y, member, x, y, rfl, holds⟩
69
+
70
+ def exLinkedCoverageFields {n} (z : Fin n) (body : BoundedFormula (n + 3)) : BoundedFormula n :=
71
+ exPairFields z (exPairFields 0 (exPairFields 3
72
+ (exPairFields 0 (exPairFields 0 (exPairFields 0
73
+ (.conj (tupleShapeFormula 6 0)
74
+ (reindex (Fin.cases 9 (Fin.cases 1 (Fin.cases 7
75
+ (fun i => i.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ)))) body)))))))
76
+
77
+ theorem truth_exLinkedCoverageFields {n} (z : Fin n) (body : BoundedFormula (n + 3))
78
+ (env : Fin n → ZFSet.{u}) :
79
+ Truth (exLinkedCoverageFields z body) env ↔
80
+ ∃ P G cutoff, LinkedCoverageFieldsCode (env z) P G cutoff ∧
81
+ Truth body (extend cutoff (extend G (extend P env))) := by
82
+ simp only [exLinkedCoverageFields, truth_exPairFields, Truth, truth_tupleShapeFormula,
83
+ truth_reindex]
84
+ have rearrange (s outer cutoff serial P tail r tail' μ tail'' G rest : ZFSet.{u}) :
85
+ (fun i => extend rest (extend G (extend tail'' (extend μ (extend tail' (extend r
86
+ (extend tail (extend P (extend serial (extend cutoff (extend outer (extend s env)))))))))))
87
+ (Fin.cases 9 (Fin.cases 1 (Fin.cases 7
88
+ (fun j => j.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ))) i)) =
89
+ extend cutoff (extend G (extend P env)) := by
90
+ funext i
91
+ refine Fin.cases ?_ (fun j => Fin.cases ?_ (fun k => Fin.cases ?_ (fun l => ?_) k) j) i <;> rfl
92
+ simp only [rearrange]
93
+ change (∃ s outer, env z = ZFSet.pair s outer ∧ ∃ cutoff serial,
94
+ outer = ZFSet.pair cutoff serial ∧ ∃ P tail, s = ZFSet.pair P tail ∧
95
+ ∃ r tail', tail = ZFSet.pair r tail' ∧ ∃ μ tail'', tail' = ZFSet.pair μ tail'' ∧
96
+ ∃ G rest, tail'' = ZFSet.pair G rest ∧
97
+ (∃ fields, rest = nonemptyTupleCode 6 fields) ∧
98
+ Truth body (extend cutoff (extend G (extend P env)))) ↔ _
99
+ constructor
100
+ · rintro ⟨s, outer, equal, cutoff, serial, rfl, P, tail, rfl, r, tail', rfl,
101
+ μ, tail'', rfl, G, rest, rfl, ⟨fields, rfl⟩, holds⟩
102
+ exact ⟨P, G, cutoff, ⟨r, μ, fields 0, fields 1, fields 2, fields 3, fields 4,
103
+ fields 5, fields 6, serial, equal⟩, holds⟩
104
+ · rintro ⟨P, G, cutoff, ⟨r, μ, m, inv, one, action, bottom, top, height, serial, equal⟩, holds⟩
105
+ let fields : Fin 7 → ZFSet.{u} := Fin.cases m (Fin.cases inv (Fin.cases one
106
+ (Fin.cases action (Fin.cases bottom (Fin.cases top (fun _ => height))))))
107
+ refine ⟨_, _, equal, cutoff, serial, rfl, P, _, rfl, r, _, rfl, μ, _, rfl,
108
+ G, nonemptyTupleCode 6 fields, rfl, ⟨fields, rfl⟩, holds⟩
109
+
110
+
111
+
112
+
113
+
114
+ def exMainLimitStageFields {n} (T S : Fin n) (body : BoundedFormula (n + 4)) : BoundedFormula n :=
115
+ exGraphFields S (.conj (.mem 1 T.succ.succ)
116
+ (exLinkedCoverageFields 0 (reindex
117
+ (Fin.cases 0 (Fin.cases 1 (Fin.cases 2 (Fin.cases 4
118
+ (fun i => i.succ.succ.succ.succ.succ))))) body)))
119
+
120
+ theorem truth_exMainLimitStageFields {n} (T S : Fin n) (body : BoundedFormula (n + 4))
121
+ (env : Fin n → ZFSet.{u}) :
122
+ Truth (exMainLimitStageFields T S body) env ↔
123
+ ∃ i z P G t, i ∈ env T ∧ ZFSet.pair i z ∈ env S ∧
124
+ LinkedCoverageFieldsCode z P G t ∧ Truth body (extend t (extend G (extend P (extend i env)))) := by
125
+ simp only [exMainLimitStageFields, truth_exGraphFields, Truth, truth_exLinkedCoverageFields,
126
+ truth_reindex]
127
+ have rearrange (i z P G t : ZFSet.{u}) :
128
+ (fun j => extend t (extend G (extend P (extend z (extend i env))))
129
+ (Fin.cases 0 (Fin.cases 1 (Fin.cases 2 (Fin.cases 4
130
+ (fun k => k.succ.succ.succ.succ.succ)))) j)) =
131
+ extend t (extend G (extend P (extend i env))) := by
132
+ funext j
133
+ refine Fin.cases ?_ (fun k => Fin.cases ?_ (fun l => Fin.cases ?_
134
+ (fun m => Fin.cases ?_ (fun a => ?_) m) l) k) j <;> rfl
135
+ simp only [rearrange]
136
+ change (∃ i z, ZFSet.pair i z ∈ env S ∧ i ∈ env T ∧ ∃ P G t,
137
+ LinkedCoverageFieldsCode z P G t ∧ Truth body (extend t (extend G (extend P (extend i env))))) ↔ _
138
+ constructor
139
+ · rintro ⟨i,z,entry,member,P,G,t,shape,holds⟩
140
+ exact ⟨i,z,P,G,t,member,entry,shape,holds⟩
141
+ · rintro ⟨i,z,P,G,t,member,entry,shape,holds⟩
142
+ exact ⟨i,z,entry,member,P,G,t,shape,holds⟩
143
+
144
+ def exMainLimitConeFields {n} (T S row : Fin n) (body : BoundedFormula (n + 6)) : BoundedFormula n :=
145
+ exMainLimitStageFields T S (exGraphFields row.succ.succ.succ.succ
146
+ (.conj (orderedPairFormula 1 T.succ.succ.succ.succ.succ.succ 5)
147
+ (exPairFields 0 (reindex (Fin.cases 0 (Fin.cases 1 (Fin.cases 4 (Fin.cases 5
148
+ (Fin.cases 6 (Fin.cases 7 (fun i => i.succ.succ.succ.succ.succ.succ.succ.succ))))))) body))))
149
+
150
+ theorem truth_exMainLimitConeFields {n} (T S row : Fin n) (body : BoundedFormula (n + 6))
151
+ (env : Fin n → ZFSet.{u}) :
152
+ Truth (exMainLimitConeFields T S row body) env ↔
153
+ ∃ i P G t points actors, MainLimitConeEntryCode (env T) (env S) (env row) i P G t points actors ∧
154
+ Truth body (extend actors (extend points (extend t (extend G (extend P (extend i env)))))) := by
155
+ simp only [exMainLimitConeFields, truth_exMainLimitStageFields, truth_exGraphFields, Truth,
156
+ truth_orderedPairFormula, truth_exPairFields, truth_reindex]
157
+ have rearrange (i P G t key value points actors : ZFSet.{u}) :
158
+ (fun j => extend actors (extend points (extend value (extend key (extend t
159
+ (extend G (extend P (extend i env)))))))
160
+ (Fin.cases 0 (Fin.cases 1 (Fin.cases 4 (Fin.cases 5 (Fin.cases 6
161
+ (Fin.cases 7 (fun k => k.succ.succ.succ.succ.succ.succ.succ.succ)))))) j)) =
162
+ extend actors (extend points (extend t (extend G (extend P (extend i env))))) := by
163
+ funext j
164
+ refine Fin.cases ?_ (fun a => Fin.cases ?_ (fun b => Fin.cases ?_ (fun c =>
165
+ Fin.cases ?_ (fun d => Fin.cases ?_ (fun e => Fin.cases ?_ (fun f => ?_) e) d) c) b) a) j <;> rfl
166
+ simp only [rearrange]
167
+ change (∃ i z P G t, i ∈ env T ∧ ZFSet.pair i z ∈ env S ∧ LinkedCoverageFieldsCode z P G t ∧
168
+ ∃ key value, ZFSet.pair key value ∈ env row ∧ key = ZFSet.pair (env T) i ∧
169
+ ∃ points actors, value = ZFSet.pair points actors ∧
170
+ Truth body (extend actors (extend points (extend t (extend G (extend P (extend i env))))))) ↔ _
171
+ constructor
172
+ · rintro ⟨i,z,P,G,t,member,entry,shape,key,value,rowEntry,rfl,points,actors,rfl,holds⟩
173
+ exact ⟨i,P,G,t,points,actors,⟨member,z,entry,shape,rowEntry⟩,holds⟩
174
+ · rintro ⟨i,P,G,t,points,actors,⟨member,z,entry,shape,rowEntry⟩,holds⟩
175
+ exact ⟨i,z,P,G,t,member,entry,shape,_,_,rowEntry,rfl,points,actors,rfl,holds⟩
176
+
177
+
178
+
179
+
180
+
181
+ def certificateGraphEntryAt {n} (j F B f k : Fin n) : BoundedFormula n :=
182
+ exGraphFields k (.conj (.equal 1 j.succ.succ)
183
+ (exPairFields 0 (.conj (.equal 1 F.succ.succ.succ.succ)
184
+ (orderedPairFormula 0 B.succ.succ.succ.succ f.succ.succ.succ.succ))))
185
+
186
+ theorem truth_certificateGraphEntryAt {n} (j F B f k : Fin n)
187
+ (env : Fin n → ZFSet.{u}) :
188
+ Truth (certificateGraphEntryAt j F B f k) env ↔
189
+ ZFSet.pair (env j) (ZFSet.pair (env F) (ZFSet.pair (env B) (env f))) ∈ env k := by
190
+ simp only [certificateGraphEntryAt, truth_exGraphFields, Truth,
191
+ truth_exPairFields, truth_orderedPairFormula]
192
+ change (∃ key certificate, ZFSet.pair key certificate ∈ env k ∧ key = env j ∧
193
+ ∃ profile tail, certificate = ZFSet.pair profile tail ∧ profile = env F ∧
194
+ tail = ZFSet.pair (env B) (env f)) ↔ _
195
+ constructor
196
+ · rintro ⟨key, certificate, entry, rfl, profile, tail, rfl, rfl, rfl⟩
197
+ exact entry
198
+ · intro entry
199
+ exact ⟨env j, _, entry, rfl, env F, _, rfl, rfl, rfl⟩
200
+
201
+ def enumerationGraphEntryAt {n} (j e names g : Fin n) : BoundedFormula n :=
202
+ exGraphFields g (.conj (.equal 1 j.succ.succ)
203
+ (orderedPairFormula 0 e.succ.succ names.succ.succ))
204
+
205
+ theorem truth_enumerationGraphEntryAt {n} (j e names g : Fin n)
206
+ (env : Fin n → ZFSet.{u}) :
207
+ Truth (enumerationGraphEntryAt j e names g) env ↔
208
+ ZFSet.pair (env j) (ZFSet.pair (env e) (env names)) ∈ env g := by
209
+ simp only [enumerationGraphEntryAt, truth_exGraphFields, Truth, truth_orderedPairFormula]
210
+ change (∃ key pair, ZFSet.pair key pair ∈ env g ∧ key = env j ∧
211
+ pair = ZFSet.pair (env e) (env names)) ↔ _
212
+ constructor
213
+ · rintro ⟨key, pair, entry, rfl, rfl⟩
214
+ exact entry
215
+ · intro entry
216
+ exact ⟨env j, _, entry, rfl, rfl⟩
217
+
218
+
219
+
220
+
221
+
222
+ def relativeAntichainFamilyFormula {n} (j A Q order domains : Fin n) : BoundedFormula n :=
223
+ exGraphFields domains (.conj (.equal 1 j.succ.succ)
224
+ (relativeMaximalAntichainFormula Q.succ.succ order.succ.succ 0 A.succ.succ))
225
+
226
+ theorem truth_relativeAntichainFamilyFormula {n} (j A Q order domains : Fin n)
227
+ (env : Fin n → ZFSet.{u}) :
228
+ Truth (relativeAntichainFamilyFormula j A Q order domains) env ↔
229
+ ∃ D, ZFSet.pair (env j) D ∈ env domains ∧
230
+ RelativeMaximalAntichainCode (env Q) (env order) D (env A) := by
231
+ simp only [relativeAntichainFamilyFormula, truth_exGraphFields, Truth,
232
+ truth_relativeMaximalAntichainFormula]
233
+ change (∃ key D, ZFSet.pair key D ∈ env domains ∧ key = env j ∧
234
+ RelativeMaximalAntichainCode (env Q) (env order) D (env A)) ↔ _
235
+ constructor
236
+ · rintro ⟨key, D, entry, rfl, code⟩
237
+ exact ⟨D, entry, code⟩
238
+ · rintro ⟨D, entry, code⟩
239
+ exact ⟨env j, D, entry, rfl, code⟩
240
+
241
+
242
+
243
+
244
+
245
+ def assignmentQueryWithinFormula {n} (X T q : Fin n) : BoundedFormula n :=
246
+ exPairFields q (stageOneAssignmentsSubsetFormula 0 X.succ.succ T.succ.succ)
247
+
248
+ theorem truth_assignmentQueryWithinFormula {n} (X T q : Fin n)
249
+ (env : Fin n → ZFSet.{u}) :
250
+ Truth (assignmentQueryWithinFormula X T q) env ↔
251
+ AssignmentQueryWithin (env X) (env T) (env q) := by
252
+ simp only [assignmentQueryWithinFormula, truth_exPairFields,
253
+ truth_stageOneAssignmentsSubsetFormula]
254
+ rfl
255
+
256
+ def representativeIndexAdditionsMemberFormula {n} (i I T Q c X : Fin n) : BoundedFormula n :=
257
+ .conj (.mem i I) (exMem Q
258
+ (.conj (assignmentQueryWithinFormula X.succ T.succ 0)
259
+ (exGraphFields c.succ (.conj (.equal 1 2)
260
+ (exPairFields 0
261
+ (exMem T.succ.succ.succ.succ.succ
262
+ (exMem T.succ.succ.succ.succ.succ.succ
263
+ (exMem 2 (stageOneAssignmentFormula 0
264
+ i.succ.succ.succ.succ.succ.succ.succ.succ 2 1)))))))))
265
+
266
+ theorem truth_representativeIndexAdditionsMemberFormula {n} (i I T Q c X : Fin n)
267
+ (env : Fin n → ZFSet.{u}) :
268
+ Truth (representativeIndexAdditionsMemberFormula i I T Q c X) env ↔
269
+ env i ∈ representativeIndexAdditions (env I) (env T) (env Q) (env c) (env X) := by
270
+ simp only [representativeIndexAdditionsMemberFormula, Truth, truth_exMem,
271
+ truth_assignmentQueryWithinFormula, truth_exGraphFields, truth_exPairFields,
272
+ truth_stageOneAssignmentFormula]
273
+ rw [mem_representativeIndexAdditions]
274
+ change (env i ∈ env I ∧ ∃ q ∈ env Q, AssignmentQueryWithin (env X) (env T) q ∧
275
+ ∃ key value, ZFSet.pair key value ∈ env c ∧ key = q ∧
276
+ ∃ row A, value = ZFSet.pair row A ∧ ∃ v ∈ env T, ∃ w ∈ env T,
277
+ ∃ z ∈ A, z = stageOneAssignment (env i) v w) ↔ _
278
+ apply and_congr Iff.rfl
279
+ constructor
280
+ · rintro ⟨q, hq, localQuery, key, value, entry, rfl, row, A, rfl, v, hv, w, hw, z, hz, rfl⟩
281
+ exact ⟨key, hq, localQuery, row, A, entry, v, hv, w, hw, hz⟩
282
+ · rintro ⟨q, hq, localQuery, row, A, entry, v, hv, w, hw, hz⟩
283
+ exact ⟨q, hq, localQuery, q, ZFSet.pair row A, entry, rfl, row, A, rfl,
284
+ v, hv, w, hw, stageOneAssignment (env i) v w, hz, rfl⟩
285
+
286
+
287
+
288
+
289
+
290
+ def supportedCertificateFormula {n}
291
+ (nodes N order R niceEval visibilityEval value F B f : Fin n) : BoundedFormula n :=
292
+ .conj (.allMem F (.mem 0 nodes.succ))
293
+ (.conj (.allMem B (.mem 0 F.succ))
294
+ (.conj (.allMem F (exMem B.succ (pairMembershipFormula 0 1 order.succ.succ)))
295
+ (.conj (functionFormula B N f)
296
+ (.conj
297
+ (.neg (exGraphFields visibilityEval
298
+ (.conj (.mem 1 nodes.succ.succ)
299
+ (.neg (.conj (imp (.mem value.succ.succ 0) (.mem 1 F.succ.succ))
300
+ (imp (.mem 1 F.succ.succ) (.mem value.succ.succ 0)))))))
301
+ (.allMem B (.allMem N.succ
302
+ (imp (pairMembershipFormula 1 0 f.succ.succ)
303
+ (.conj (pairMembershipFormula 1 0 R.succ.succ)
304
+ (pairMembershipFormula 0 value.succ.succ niceEval.succ.succ)))))))))
305
+
306
+ theorem truth_supportedCertificateFormula {n}
307
+ (nodes N order R niceEval visibilityEval value F B f : Fin n)
308
+ (env : Fin n → ZFSet.{u}) :
309
+ Truth (supportedCertificateFormula nodes N order R niceEval visibilityEval value F B f) env ↔
310
+ SupportedEqualityCertificate (env nodes) (env N) (env order) (env R)
311
+ (env niceEval) (env visibilityEval) (env value) (env F) (env B) (env f) := by
312
+ classical
313
+ simp only [supportedCertificateFormula, Truth, truth_exMem, truth_pairMembershipFormula,
314
+ truth_functionFormula, truth_exGraphFields, truth_imp, not_exists, not_and, not_not,
315
+ ← iff_def]
316
+ rfl
317
+
318
+ def supportedCertificateEntryFormula {n}
319
+ (entry J PF PB WF nodes N order R inputEval niceEval visibilityEval : Fin n) :
320
+ BoundedFormula n :=
321
+ exPairFields entry (exPairFields 0 (exPairFields 0
322
+ (.conj (.mem 5 J.succ.succ.succ.succ.succ.succ)
323
+ (.conj (.mem 3 PF.succ.succ.succ.succ.succ.succ)
324
+ (.conj (.mem 1 PB.succ.succ.succ.succ.succ.succ)
325
+ (.conj (.mem 0 WF.succ.succ.succ.succ.succ.succ)
326
+ (exGraphFields inputEval.succ.succ.succ.succ.succ.succ
327
+ (.conj (.equal 1 7)
328
+ (supportedCertificateFormula
329
+ nodes.succ.succ.succ.succ.succ.succ.succ.succ
330
+ N.succ.succ.succ.succ.succ.succ.succ.succ
331
+ order.succ.succ.succ.succ.succ.succ.succ.succ
332
+ R.succ.succ.succ.succ.succ.succ.succ.succ
333
+ niceEval.succ.succ.succ.succ.succ.succ.succ.succ
334
+ visibilityEval.succ.succ.succ.succ.succ.succ.succ.succ
335
+ 0 5 3 2)))))))))
336
+
337
+ theorem truth_supportedCertificateEntryFormula {n}
338
+ (entry J PF PB WF nodes N order R inputEval niceEval visibilityEval : Fin n)
339
+ (env : Fin n → ZFSet.{u}) :
340
+ Truth (supportedCertificateEntryFormula entry J PF PB WF nodes N order R
341
+ inputEval niceEval visibilityEval) env ↔
342
+ ∃ j ∈ env J, ∃ F ∈ env PF, ∃ B ∈ env PB, ∃ f ∈ env WF,
343
+ env entry = ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∧
344
+ ∃ value, ZFSet.pair j value ∈ env inputEval ∧
345
+ SupportedEqualityCertificate (env nodes) (env N) (env order) (env R)
346
+ (env niceEval) (env visibilityEval) value F B f := by
347
+ simp only [supportedCertificateEntryFormula, truth_exPairFields, Truth,
348
+ truth_exGraphFields, truth_supportedCertificateFormula]
349
+ change (∃ j tail, env entry = ZFSet.pair j tail ∧
350
+ ∃ F rest, tail = ZFSet.pair F rest ∧
351
+ ∃ B f, rest = ZFSet.pair B f ∧
352
+ j ∈ env J ∧ F ∈ env PF ∧ B ∈ env PB ∧ f ∈ env WF ∧
353
+ ∃ j' value, ZFSet.pair j' value ∈ env inputEval ∧ j' = j ∧
354
+ SupportedEqualityCertificate (env nodes) (env N) (env order) (env R)
355
+ (env niceEval) (env visibilityEval) value F B f) ↔ _
356
+ constructor
357
+ · rintro ⟨j, tail, equal, F, rest, rfl, B, f, rfl, hj, hF, hB, hf,
358
+ j', value, evaluated, rfl, certificate⟩
359
+ exact ⟨j', hj, F, hF, B, hB, f, hf, equal, value, evaluated, certificate⟩
360
+ · rintro ⟨j, hj, F, hF, B, hB, f, hf, equal, value, evaluated, certificate⟩
361
+ exact ⟨j, _, equal, F, _, rfl, B, f, rfl, hj, hF, hB, hf,
362
+ j, value, evaluated, rfl, certificate⟩
363
+
364
+
365
+
366
+
367
+
368
+ def exMainLimitImageFields {n} (actor : Bool) (T S row : Fin n)
369
+ (body : BoundedFormula (n + 1)) : BoundedFormula n :=
370
+ exMainLimitConeFields T S row (exGraphFields (if actor then 0 else 1)
371
+ (.conj (.mem 1 (if actor then 5 else 6))
372
+ (reindex (Fin.cases 0 (fun i => i.succ.succ.succ.succ.succ.succ.succ.succ)) body)))
373
+
374
+ theorem truth_exMainLimitImageFields {n} (actor : Bool) (T S row : Fin n)
375
+ (body : BoundedFormula (n + 1)) (env : Fin n → ZFSet.{u}) :
376
+ Truth (exMainLimitImageFields actor T S row body) env ↔
377
+ ∃ x, (if actor then MainLimitOldActorImageCode (env T) (env S) (env row) x
378
+ else MainLimitOldPointImageCode (env T) (env S) (env row) x) ∧ Truth body (extend x env) := by
379
+ simp only [exMainLimitImageFields, truth_exMainLimitConeFields, truth_exGraphFields, Truth, truth_reindex]
380
+ have rearrange (i P G t points actors y x : ZFSet.{u}) :
381
+ (fun j => extend x (extend y (extend actors (extend points (extend t
382
+ (extend G (extend P (extend i env)))))))
383
+ (Fin.cases 0 (fun k => k.succ.succ.succ.succ.succ.succ.succ.succ) j)) = extend x env := by
384
+ funext j
385
+ refine Fin.cases ?_ (fun k => ?_) j <;> rfl
386
+ simp only [rearrange]
387
+ cases actor <;> simp only [Bool.false_eq_true, ite_false, ite_true]
388
+ · change (∃ i P G t points actors, MainLimitConeEntryCode (env T) (env S) (env row) i P G t points actors ∧
389
+ ∃ y x, ZFSet.pair y x ∈ points ∧ y ∈ P ��� Truth body (extend x env)) ↔ _
390
+ constructor
391
+ · rintro ⟨i,P,G,t,points,actors,entry,y,x,image,member,holds⟩
392
+ exact ⟨x,⟨i,P,G,t,points,actors,y,entry,member,image⟩,holds⟩
393
+ · rintro ⟨x,⟨i,P,G,t,points,actors,y,entry,member,image⟩,holds⟩
394
+ exact ⟨i,P,G,t,points,actors,entry,y,x,image,member,holds⟩
395
+ · change (∃ i P G t points actors, MainLimitConeEntryCode (env T) (env S) (env row) i P G t points actors ∧
396
+ ∃ y x, ZFSet.pair y x ∈ actors ∧ y ∈ G ∧ Truth body (extend x env)) ↔ _
397
+ constructor
398
+ · rintro ⟨i,P,G,t,points,actors,entry,y,x,image,member,holds⟩
399
+ exact ⟨x,⟨i,P,G,t,points,actors,y,entry,member,image⟩,holds⟩
400
+ · rintro ⟨x,⟨i,P,G,t,points,actors,y,entry,member,image⟩,holds⟩
401
+ exact ⟨i,P,G,t,points,actors,entry,y,x,image,member,holds⟩
402
+
403
+ def mainLimitImageFormula {n} (actor : Bool) (T S row x : Fin n) : BoundedFormula n :=
404
+ exMainLimitImageFields actor T S row (.equal 0 x.succ)
405
+
406
+ theorem truth_mainLimitImageFormula {n} (actor : Bool) (T S row x : Fin n)
407
+ (env : Fin n → ZFSet.{u}) : Truth (mainLimitImageFormula actor T S row x) env ↔
408
+ (if actor then MainLimitOldActorImageCode (env T) (env S) (env row) (env x)
409
+ else MainLimitOldPointImageCode (env T) (env S) (env row) (env x)) := by
410
+ rw [mainLimitImageFormula, truth_exMainLimitImageFields]
411
+ change (∃ y, _ ∧ y = env x) ↔ _
412
+ constructor
413
+ · rintro ⟨y, member, rfl⟩
414
+ exact member
415
+ · exact fun member => ⟨env x, member, rfl⟩
416
+
417
+ def mainLimitOldCutoffFormula {n} (T S t : Fin n) : BoundedFormula n :=
418
+ exMainLimitStageFields T S (disj (.equal t.succ.succ.succ.succ 0)
419
+ (.mem t.succ.succ.succ.succ 0))
420
+
421
+ theorem truth_mainLimitOldCutoffFormula {n} (T S t : Fin n) (env : Fin n → ZFSet.{u}) :
422
+ Truth (mainLimitOldCutoffFormula T S t) env ↔ MainLimitOldCutoffCode (env T) (env S) (env t) := by
423
+ simp only [mainLimitOldCutoffFormula, truth_exMainLimitStageFields, truth_disj, Truth]
424
+ change (∃ i z P G cutoff, i ∈ env T ∧ ZFSet.pair i z ∈ env S ∧
425
+ LinkedCoverageFieldsCode z P G cutoff ∧ (env t = cutoff ∨ env t ∈ cutoff)) ↔ _
426
+ constructor
427
+ · rintro ⟨i,z,P,G,cutoff,member,entry,shape,bound⟩
428
+ exact ⟨i,member,z,entry,P,G,cutoff,shape,bound⟩
429
+ · rintro ⟨i,member,z,entry,P,G,cutoff,shape,bound⟩
430
+ exact ⟨i,z,P,G,cutoff,member,entry,shape,bound⟩
431
+
432
+
433
+
434
+
435
+
436
+ def mainLimitPointCoverageFormula {n} (T S row Q top : Fin n) : BoundedFormula n :=
437
+ .conj (.allMem Q (imp (.neg (.equal 0 top.succ))
438
+ (mainLimitImageFormula false T.succ S.succ row.succ 0)))
439
+ (.neg (exMainLimitImageFields false T S row
440
+ (.neg (.conj (.mem 0 Q.succ) (.neg (.equal 0 top.succ))))))
441
+
442
+ theorem truth_mainLimitPointCoverageFormula {n} (T S row Q top : Fin n)
443
+ (env : Fin n → ZFSet.{u}) : Truth (mainLimitPointCoverageFormula T S row Q top) env ↔
444
+ ∀ x, (x ∈ env Q ∧ x ≠ env top) ↔ MainLimitOldPointImageCode (env T) (env S) (env row) x := by
445
+ classical
446
+ simp only [mainLimitPointCoverageFormula, Truth, truth_imp, truth_mainLimitImageFormula,
447
+ truth_exMainLimitImageFields, Bool.false_eq_true, ite_false, not_exists, not_and, not_not, Classical.not_imp]
448
+ change ((∀ x ∈ env Q, x ≠ env top → MainLimitOldPointImageCode (env T) (env S) (env row) x) ∧
449
+ ∀ x, MainLimitOldPointImageCode (env T) (env S) (env row) x → x ∈ env Q ∧ x ≠ env top) ↔ _
450
+ constructor
451
+ · rintro ⟨forward, reverse⟩ x
452
+ exact ⟨fun h => forward x h.1 h.2, reverse x⟩
453
+ · intro laws
454
+ exact ⟨fun x member different => (laws x).1 ⟨member,different⟩, fun x => (laws x).2⟩
455
+
456
+ def mainLimitActorCoverageFormula {n} (T S row H : Fin n) : BoundedFormula n :=
457
+ .conj (.allMem H (mainLimitImageFormula true T.succ S.succ row.succ 0))
458
+ (.neg (exMainLimitImageFields true T S row (.neg (.mem 0 H.succ))))
459
+
460
+ theorem truth_mainLimitActorCoverageFormula {n} (T S row H : Fin n)
461
+ (env : Fin n → ZFSet.{u}) : Truth (mainLimitActorCoverageFormula T S row H) env ↔
462
+ ∀ g, g ∈ env H ↔ MainLimitOldActorImageCode (env T) (env S) (env row) g := by
463
+ classical
464
+ simp only [mainLimitActorCoverageFormula, Truth, truth_mainLimitImageFormula,
465
+ truth_exMainLimitImageFields, ite_true, not_exists, not_and, not_not]
466
+ change ((∀ g ∈ env H, MainLimitOldActorImageCode (env T) (env S) (env row) g) ∧
467
+ ∀ g, MainLimitOldActorImageCode (env T) (env S) (env row) g → g ∈ env H) ↔ _
468
+ exact ⟨fun h g => ⟨h.1 g,h.2 g⟩, fun h => ⟨fun g => (h g).1,fun g => (h g).2⟩⟩
469
+
470
+ def mainLimitStrictTopFormula {n} (T S row R top : Fin n) : BoundedFormula n :=
471
+ .neg (exMainLimitConeFields T S row (exGraphFields 1 (.neg
472
+ (.conj (pairMembershipFormula 0 top.succ.succ.succ.succ.succ.succ.succ.succ
473
+ R.succ.succ.succ.succ.succ.succ.succ.succ)
474
+ (.neg (pairMembershipFormula top.succ.succ.succ.succ.succ.succ.succ.succ 0
475
+ R.succ.succ.succ.succ.succ.succ.succ.succ))))))
476
+
477
+ theorem truth_mainLimitStrictTopFormula {n} (T S row R top : Fin n)
478
+ (env : Fin n → ZFSet.{u}) : Truth (mainLimitStrictTopFormula T S row R top) env ↔
479
+ ∀ i P G t points actors, MainLimitConeEntryCode (env T) (env S) (env row) i P G t points actors →
480
+ ∀ x y, ZFSet.pair x y ∈ points → ZFSet.pair y (env top) ∈ env R ∧
481
+ ZFSet.pair (env top) y ∉ env R := by
482
+ classical
483
+ simp only [mainLimitStrictTopFormula, Truth, truth_exMainLimitConeFields,
484
+ truth_exGraphFields, truth_pairMembershipFormula, not_exists, not_and, not_not, Classical.not_imp]
485
+ rfl
486
+
487
+ def mainLimitCutoffFormula {n} (T S cutoff : Fin n) : BoundedFormula n :=
488
+ .conj (.allMem cutoff (mainLimitOldCutoffFormula T.succ S.succ 0))
489
+ (.neg (exMainLimitStageFields T S (.neg
490
+ (.conj (.mem 0 cutoff.succ.succ.succ.succ)
491
+ (.allMem 0 (.mem 0 cutoff.succ.succ.succ.succ.succ))))))
492
+
493
+ theorem truth_mainLimitCutoffFormula {n} (T S cutoff : Fin n) (env : Fin n → ZFSet.{u}) :
494
+ Truth (mainLimitCutoffFormula T S cutoff) env ↔
495
+ ∀ t, t ∈ env cutoff ↔ MainLimitOldCutoffCode (env T) (env S) t := by
496
+ classical
497
+ simp only [mainLimitCutoffFormula, Truth, truth_mainLimitOldCutoffFormula,
498
+ truth_exMainLimitStageFields, not_exists, not_and, not_not, Classical.not_imp]
499
+ change ((∀ t ∈ env cutoff, MainLimitOldCutoffCode (env T) (env S) t) ∧
500
+ ∀ i z P G t, i ∈ env T → ZFSet.pair i z ∈ env S → LinkedCoverageFieldsCode z P G t →
501
+ t ∈ env cutoff ∧ ∀ s ∈ t, s ∈ env cutoff) ↔ _
502
+ constructor
503
+ · rintro ⟨forward,bound⟩ t
504
+ refine ⟨forward t, ?_⟩
505
+ rintro ⟨i,member,z,entry,P,G,s,shape,equal | lower⟩
506
+ · exact equal.symm ▸ (bound i z P G s member entry shape).1
507
+ · exact (bound i z P G s member entry shape).2 t lower
508
+ · intro laws
509
+ refine ⟨fun t => (laws t).1, ?_⟩
510
+ intro i z P G t member entry shape
511
+ exact ⟨(laws t).2 ⟨i,member,z,entry,P,G,t,shape,Or.inl rfl⟩,
512
+ fun s lower => (laws s).2 ⟨i,member,z,entry,P,G,t,shape,Or.inr lower⟩⟩
513
+
514
+ def mainLimitTopBirthFormula {n} (top cutoff birth : Fin n) : BoundedFormula n :=
515
+ .conj (pairMembershipFormula top cutoff birth)
516
+ (.neg (exGraphFields birth (.conj (.equal 0 cutoff.succ.succ)
517
+ (.neg (.equal 1 top.succ.succ)))))
518
+
519
+ theorem truth_mainLimitTopBirthFormula {n} (top cutoff birth : Fin n)
520
+ (env : Fin n → ZFSet.{u}) : Truth (mainLimitTopBirthFormula top cutoff birth) env ↔
521
+ ∀ x, ZFSet.pair x (env cutoff) ∈ env birth ↔ x = env top := by
522
+ classical
523
+ simp only [mainLimitTopBirthFormula, Truth, truth_pairMembershipFormula,
524
+ truth_exGraphFields, not_exists, not_and, not_not]
525
+ change (ZFSet.pair (env top) (env cutoff) ∈ env birth ∧
526
+ ∀ x t, ZFSet.pair x t ∈ env birth → t = env cutoff → x = env top) ↔ _
527
+ constructor
528
+ · rintro ⟨entry,unique⟩ x
529
+ exact ⟨fun image => unique x (env cutoff) image rfl, fun equal => equal.symm ▸ entry⟩
530
+ · intro laws
531
+ exact ⟨(laws (env top)).2 rfl, fun x t image equal => (laws x).1 (equal ▸ image)⟩
532
+
533
+ def mainLimitCoverageFormula {n} (T S row Q H R top cutoff birth : Fin n) : BoundedFormula n :=
534
+ .conj (mainLimitPointCoverageFormula T S row Q top)
535
+ (.conj (mainLimitActorCoverageFormula T S row H)
536
+ (.conj (mainLimitStrictTopFormula T S row R top)
537
+ (.conj (mainLimitCutoffFormula T S cutoff) (mainLimitTopBirthFormula top cutoff birth))))
538
+
539
+ theorem truth_mainLimitCoverageFormula {n} (T S row Q H R top cutoff birth : Fin n)
540
+ (env : Fin n → ZFSet.{u}) : Truth (mainLimitCoverageFormula T S row Q H R top cutoff birth) env ↔
541
+ MainLimitCoverageGraphCode (env T) (env S) (env row) (env Q) (env H) (env R)
542
+ (env top) (env cutoff) (env birth) := by
543
+ simp only [mainLimitCoverageFormula, Truth, truth_mainLimitPointCoverageFormula,
544
+ truth_mainLimitActorCoverageFormula, truth_mainLimitStrictTopFormula,
545
+ truth_mainLimitCutoffFormula, truth_mainLimitTopBirthFormula]
546
+ exact ⟨fun h => ⟨h.1,h.2.1,h.2.2.1,h.2.2.2.1,h.2.2.2.2⟩,
547
+ fun h => ⟨h.points,h.actors,h.strict_top,h.cutoff_mem,h.top_birth⟩⟩
548
+
549
+ theorem realize_mainLimitCoverageFormula (M : TransitiveGround.{u}) {n}
550
+ (T S row Q H R top cutoff birth : Fin n) (env : Fin n → ZFSet.{u})
551
+ (members : ∀ i, env i ∈ M.sets) :
552
+ Realize M.sets (mainLimitCoverageFormula T S row Q H R top cutoff birth).toFormula env ↔
553
+ MainLimitCoverageGraphCode (env T) (env S) (env row) (env Q) (env H) (env R)
554
+ (env top) (env cutoff) (env birth) :=
555
+ (realize_toFormula M _ env members).trans (truth_mainLimitCoverageFormula T S row Q H R top cutoff birth env)
556
+
557
+ end PartitionPilot.Forcing.BoundedFormula
558
+
559
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/MainPrefixTraceStepFormulas.lean CHANGED
@@ -1,164 +1,164 @@
1
- import OAI.SetTheory.PartitionPrinciple.Definability.PreservedMainPrefixHistoryFormulas
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
- open SetFormula
9
- universe u
10
-
11
- namespace SetFormula
12
- def mainPrefixAtIndexFormula {n} (T q : Fin n) : SetFormula n :=
13
- exBlock 2 (BoundedFormula.mainPrefixTupleFormula (suffixIndex n 2 q)
14
- (suffixIndex n 2 T) (prefixIndex n 2 0) (prefixIndex n 2 1)).toFormula
15
-
16
- def mainPrefixAtSuccessorFormula {n} (α q : Fin n) : SetFormula n :=
17
- ex (.conj (BoundedFormula.successorFormula 0 α.succ).toFormula
18
- (mainPrefixAtIndexFormula 0 q.succ))
19
-
20
- def mainPrefixHistoryExtendsFormula {n} (p q : Fin n) : SetFormula n :=
21
- .all (.all (imp (BoundedFormula.pairMembershipFormula 1 0 p.succ.succ).toFormula
22
- (mainPrefixExtensionFormula 0 q.succ.succ)))
23
-
24
- end SetFormula
25
-
26
- namespace TransitiveGround
27
- variable (M : TransitiveGround.{u})
28
-
29
- theorem realize_mainPrefixAtIndexFormula {n} (T q : Fin n)
30
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
31
- Realize M.sets (mainPrefixAtIndexFormula T q) env ↔ MainPrefixAtIndex (env T) (env q) := by
32
- rw [mainPrefixAtIndexFormula, realize_exBlock]
33
- have actual (f : Fin 2 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) :=
34
- BoundedFormula.realize_mainPrefixTupleFormula M (suffixIndex n 2 q)
35
- (suffixIndex n 2 T) (prefixIndex n 2 0) (prefixIndex n 2 1)
36
- (extendMany 2 f env) (extendMany_members 2 f env ground members)
37
- simp only [extendMany_prefix, extendMany_suffix] at actual
38
- constructor
39
- · rintro ⟨f, ground, recognized⟩
40
- exact ⟨f 0, f 1, (actual f ground).1 recognized⟩
41
- · rintro ⟨S, E, encoded⟩
42
- have fields := M.mainPrefixCode_fields_mem (encoded ▸ members q)
43
- let f : Fin 2 → ZFSet.{u} := Fin.cases S (fun _ => E)
44
- have ground : ∀ j, f j ∈ M.sets := Fin.cases fields.2.1 (fun _ => fields.2.2)
45
- exact ⟨f, ground, (actual f ground).2 encoded⟩
46
-
47
- theorem realize_mainPrefixAtSuccessorFormula {n} (α q : Fin n)
48
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
49
- Realize M.sets (mainPrefixAtSuccessorFormula α q) env ↔
50
- MainPrefixAtIndex (insert (env α) (env α)) (env q) := by
51
- rw [mainPrefixAtSuccessorFormula, realize_ex]
52
- have actual T (ground : T ∈ M.sets) :
53
- Realize M.sets (.conj (BoundedFormula.successorFormula 0 α.succ).toFormula
54
- (mainPrefixAtIndexFormula 0 q.succ)) (extend T env) ↔
55
- T = insert (env α) (env α) ∧ MainPrefixAtIndex T (env q) := by
56
- change (_ ∧ _) ↔ _
57
- rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases ground members),
58
- BoundedFormula.truth_successorFormula,
59
- M.realize_mainPrefixAtIndexFormula _ _ _ (Fin.cases ground members)]
60
- rfl
61
- constructor
62
- · rintro ⟨T, ground, recognized⟩
63
- obtain ⟨rfl, code⟩ := (actual T ground).1 recognized
64
- exact code
65
- · intro code
66
- obtain ⟨S, E, equal⟩ := code
67
- have ground := (M.mainPrefixCode_fields_mem (equal ▸ members q)).1
68
- exact ⟨_, ground, (actual _ ground).2 ⟨rfl, S, E, equal⟩⟩
69
-
70
- theorem realize_mainPrefixHistoryExtendsFormula {n} (p q : Fin n)
71
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
72
- Realize M.sets (mainPrefixHistoryExtendsFormula p q) env ↔
73
- MainPrefixHistoryExtends (env p) (env q) := by
74
- change (∀ i ∈ M.sets, ∀ old ∈ M.sets, Realize M.sets
75
- (imp (BoundedFormula.pairMembershipFormula 1 0 p.succ.succ).toFormula
76
- (mainPrefixExtensionFormula 0 q.succ.succ)) (extend old (extend i env))) ↔ _
77
- have actual i old (hi : i ∈ M.sets) (ho : old ∈ M.sets) :
78
- Realize M.sets
79
- (imp (BoundedFormula.pairMembershipFormula 1 0 p.succ.succ).toFormula
80
- (mainPrefixExtensionFormula 0 q.succ.succ)) (extend old (extend i env)) ↔
81
- (ZFSet.pair i old ∈ env p → MainPrefixExtends old (env q)) := by
82
- rw [realize_imp, BoundedFormula.realize_toFormula M _ _ (Fin.cases ho (Fin.cases hi members)),
83
- BoundedFormula.truth_pairMembershipFormula,
84
- M.realize_mainPrefixExtensionFormula _ _ _ (Fin.cases ho (Fin.cases hi members))]
85
- rfl
86
- constructor
87
- · intro recognized i old entry
88
- have pairGround := M.transitive (members p) entry
89
- exact (actual i old (M.pair_left pairGround) (M.pair_right pairGround)).1
90
- (recognized i (M.pair_left pairGround) old (M.pair_right pairGround)) entry
91
- · intro history i hi old ho
92
- exact (actual i old hi ho).2 (history i old)
93
-
94
- end TransitiveGround
95
- end PartitionPilot.Forcing
96
-
97
-
98
-
99
- namespace PartitionPilot.Forcing
100
- open SetFormula
101
- universe u
102
-
103
- namespace SetFormula
104
- def mainPrefixTraceBranchFormula {n} (seed g α p y : Fin n) : SetFormula n :=
105
- disj (.conj (BoundedFormula.emptyFormula α).toFormula (.equal y seed))
106
- (.conj (.neg (BoundedFormula.emptyFormula α).toFormula)
107
- (ex (.conj (mainPrefixHistoryUnionFormula p.succ 0)
108
- (BoundedFormula.pairMembershipFormula 0 y.succ g.succ).toFormula)))
109
-
110
- def mainPrefixTraceStepFormula {n} (B seed g α p y : Fin n) : SetFormula n :=
111
- .conj (.mem y B) (.conj (mainPrefixAtSuccessorFormula α y)
112
- (.conj (mainPrefixHistoryExtendsFormula p y) (mainPrefixTraceBranchFormula seed g α p y)))
113
-
114
- end SetFormula
115
-
116
- namespace TransitiveGround
117
- variable (M : TransitiveGround.{u})
118
-
119
- theorem realize_mainPrefixTraceBranchFormula {n} (seed g α p y : Fin n)
120
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
121
- Realize M.sets (mainPrefixTraceBranchFormula seed g α p y) env ↔
122
- ((env α = ∅ ∧ env y = env seed) ∨ (env α ≠ ∅ ∧
123
- ∃ input, MainPrefixHistoryUnionCode (env p) input ∧ ZFSet.pair input (env y) ∈ env g)) := by
124
- have empty := (BoundedFormula.realize_toFormula M (BoundedFormula.emptyFormula α) env members).trans
125
- (BoundedFormula.truth_emptyFormula α env)
126
- rw [mainPrefixTraceBranchFormula, realize_disj]
127
- change ((_ ∧ _) ∨ ((¬ _) ∧ _)) ↔ _
128
- rw [empty]
129
- apply or_congr Iff.rfl
130
- apply and_congr Iff.rfl
131
- rw [realize_ex]
132
- have actual input (ground : input ∈ M.sets) :
133
- Realize M.sets (.conj (mainPrefixHistoryUnionFormula p.succ 0)
134
- (BoundedFormula.pairMembershipFormula 0 y.succ g.succ).toFormula) (extend input env) ↔
135
- MainPrefixHistoryUnionCode (env p) input ∧ ZFSet.pair input (env y) ∈ env g := by
136
- change (_ ∧ _) ↔ _
137
- rw [M.realize_mainPrefixHistoryUnionFormula _ _ _ (Fin.cases ground members),
138
- BoundedFormula.realize_toFormula M _ _ (Fin.cases ground members),
139
- BoundedFormula.truth_pairMembershipFormula]
140
- rfl
141
- constructor
142
- · rintro ⟨input, ground, recognized⟩
143
- exact ⟨input, (actual input ground).1 recognized⟩
144
- · rintro ⟨input, union, entry⟩
145
- have ground := M.pair_left (M.transitive (members g) entry)
146
- exact ⟨input, ground, (actual input ground).2 ⟨union, entry⟩⟩
147
-
148
- theorem realize_mainPrefixTraceStepFormula {n} (B seed g α p y : Fin n)
149
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
150
- Realize M.sets (mainPrefixTraceStepFormula B seed g α p y) env ↔
151
- MainPrefixTraceStepCode (env B) (env seed) (env g) (env α) (env p) (env y) := by
152
- unfold mainPrefixTraceStepFormula MainPrefixTraceStepCode
153
- change (_ ∧ _ ∧ _ ∧ _) ↔ _
154
- rw [M.realize_mainPrefixAtSuccessorFormula _ _ _ members,
155
- M.realize_mainPrefixHistoryExtendsFormula _ _ _ members,
156
- M.realize_mainPrefixTraceBranchFormula _ _ _ _ _ _ members]
157
- rfl
158
-
159
- end TransitiveGround
160
- end PartitionPilot.Forcing
161
-
162
- end
163
-
164
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Definability.PreservedMainPrefixHistoryFormulas
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+ open SetFormula
9
+ universe u
10
+
11
+ namespace SetFormula
12
+ def mainPrefixAtIndexFormula {n} (T q : Fin n) : SetFormula n :=
13
+ exBlock 2 (BoundedFormula.mainPrefixTupleFormula (suffixIndex n 2 q)
14
+ (suffixIndex n 2 T) (prefixIndex n 2 0) (prefixIndex n 2 1)).toFormula
15
+
16
+ def mainPrefixAtSuccessorFormula {n} (α q : Fin n) : SetFormula n :=
17
+ ex (.conj (BoundedFormula.successorFormula 0 α.succ).toFormula
18
+ (mainPrefixAtIndexFormula 0 q.succ))
19
+
20
+ def mainPrefixHistoryExtendsFormula {n} (p q : Fin n) : SetFormula n :=
21
+ .all (.all (imp (BoundedFormula.pairMembershipFormula 1 0 p.succ.succ).toFormula
22
+ (mainPrefixExtensionFormula 0 q.succ.succ)))
23
+
24
+ end SetFormula
25
+
26
+ namespace TransitiveGround
27
+ variable (M : TransitiveGround.{u})
28
+
29
+ theorem realize_mainPrefixAtIndexFormula {n} (T q : Fin n)
30
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
31
+ Realize M.sets (mainPrefixAtIndexFormula T q) env ↔ MainPrefixAtIndex (env T) (env q) := by
32
+ rw [mainPrefixAtIndexFormula, realize_exBlock]
33
+ have actual (f : Fin 2 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) :=
34
+ BoundedFormula.realize_mainPrefixTupleFormula M (suffixIndex n 2 q)
35
+ (suffixIndex n 2 T) (prefixIndex n 2 0) (prefixIndex n 2 1)
36
+ (extendMany 2 f env) (extendMany_members 2 f env ground members)
37
+ simp only [extendMany_prefix, extendMany_suffix] at actual
38
+ constructor
39
+ · rintro ⟨f, ground, recognized⟩
40
+ exact ⟨f 0, f 1, (actual f ground).1 recognized⟩
41
+ · rintro ⟨S, E, encoded⟩
42
+ have fields := M.mainPrefixCode_fields_mem (encoded ▸ members q)
43
+ let f : Fin 2 → ZFSet.{u} := Fin.cases S (fun _ => E)
44
+ have ground : ∀ j, f j ∈ M.sets := Fin.cases fields.2.1 (fun _ => fields.2.2)
45
+ exact ⟨f, ground, (actual f ground).2 encoded⟩
46
+
47
+ theorem realize_mainPrefixAtSuccessorFormula {n} (α q : Fin n)
48
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
49
+ Realize M.sets (mainPrefixAtSuccessorFormula α q) env ↔
50
+ MainPrefixAtIndex (insert (env α) (env α)) (env q) := by
51
+ rw [mainPrefixAtSuccessorFormula, realize_ex]
52
+ have actual T (ground : T ∈ M.sets) :
53
+ Realize M.sets (.conj (BoundedFormula.successorFormula 0 α.succ).toFormula
54
+ (mainPrefixAtIndexFormula 0 q.succ)) (extend T env) ↔
55
+ T = insert (env α) (env α) ∧ MainPrefixAtIndex T (env q) := by
56
+ change (_ ∧ _) ↔ _
57
+ rw [BoundedFormula.realize_toFormula M _ _ (Fin.cases ground members),
58
+ BoundedFormula.truth_successorFormula,
59
+ M.realize_mainPrefixAtIndexFormula _ _ _ (Fin.cases ground members)]
60
+ rfl
61
+ constructor
62
+ · rintro ⟨T, ground, recognized⟩
63
+ obtain ⟨rfl, code⟩ := (actual T ground).1 recognized
64
+ exact code
65
+ · intro code
66
+ obtain ⟨S, E, equal⟩ := code
67
+ have ground := (M.mainPrefixCode_fields_mem (equal ▸ members q)).1
68
+ exact ⟨_, ground, (actual _ ground).2 ⟨rfl, S, E, equal⟩⟩
69
+
70
+ theorem realize_mainPrefixHistoryExtendsFormula {n} (p q : Fin n)
71
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
72
+ Realize M.sets (mainPrefixHistoryExtendsFormula p q) env ↔
73
+ MainPrefixHistoryExtends (env p) (env q) := by
74
+ change (∀ i ∈ M.sets, ∀ old ∈ M.sets, Realize M.sets
75
+ (imp (BoundedFormula.pairMembershipFormula 1 0 p.succ.succ).toFormula
76
+ (mainPrefixExtensionFormula 0 q.succ.succ)) (extend old (extend i env))) ↔ _
77
+ have actual i old (hi : i ∈ M.sets) (ho : old ∈ M.sets) :
78
+ Realize M.sets
79
+ (imp (BoundedFormula.pairMembershipFormula 1 0 p.succ.succ).toFormula
80
+ (mainPrefixExtensionFormula 0 q.succ.succ)) (extend old (extend i env)) ↔
81
+ (ZFSet.pair i old ∈ env p → MainPrefixExtends old (env q)) := by
82
+ rw [realize_imp, BoundedFormula.realize_toFormula M _ _ (Fin.cases ho (Fin.cases hi members)),
83
+ BoundedFormula.truth_pairMembershipFormula,
84
+ M.realize_mainPrefixExtensionFormula _ _ _ (Fin.cases ho (Fin.cases hi members))]
85
+ rfl
86
+ constructor
87
+ · intro recognized i old entry
88
+ have pairGround := M.transitive (members p) entry
89
+ exact (actual i old (M.pair_left pairGround) (M.pair_right pairGround)).1
90
+ (recognized i (M.pair_left pairGround) old (M.pair_right pairGround)) entry
91
+ · intro history i hi old ho
92
+ exact (actual i old hi ho).2 (history i old)
93
+
94
+ end TransitiveGround
95
+ end PartitionPilot.Forcing
96
+
97
+
98
+
99
+ namespace PartitionPilot.Forcing
100
+ open SetFormula
101
+ universe u
102
+
103
+ namespace SetFormula
104
+ def mainPrefixTraceBranchFormula {n} (seed g α p y : Fin n) : SetFormula n :=
105
+ disj (.conj (BoundedFormula.emptyFormula α).toFormula (.equal y seed))
106
+ (.conj (.neg (BoundedFormula.emptyFormula α).toFormula)
107
+ (ex (.conj (mainPrefixHistoryUnionFormula p.succ 0)
108
+ (BoundedFormula.pairMembershipFormula 0 y.succ g.succ).toFormula)))
109
+
110
+ def mainPrefixTraceStepFormula {n} (B seed g α p y : Fin n) : SetFormula n :=
111
+ .conj (.mem y B) (.conj (mainPrefixAtSuccessorFormula α y)
112
+ (.conj (mainPrefixHistoryExtendsFormula p y) (mainPrefixTraceBranchFormula seed g α p y)))
113
+
114
+ end SetFormula
115
+
116
+ namespace TransitiveGround
117
+ variable (M : TransitiveGround.{u})
118
+
119
+ theorem realize_mainPrefixTraceBranchFormula {n} (seed g α p y : Fin n)
120
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
121
+ Realize M.sets (mainPrefixTraceBranchFormula seed g α p y) env ↔
122
+ ((env α = ∅ ∧ env y = env seed) ∨ (env α ≠ ∅ ∧
123
+ ∃ input, MainPrefixHistoryUnionCode (env p) input ∧ ZFSet.pair input (env y) ∈ env g)) := by
124
+ have empty := (BoundedFormula.realize_toFormula M (BoundedFormula.emptyFormula α) env members).trans
125
+ (BoundedFormula.truth_emptyFormula α env)
126
+ rw [mainPrefixTraceBranchFormula, realize_disj]
127
+ change ((_ ∧ _) ∨ ((¬ _) ∧ _)) ↔ _
128
+ rw [empty]
129
+ apply or_congr Iff.rfl
130
+ apply and_congr Iff.rfl
131
+ rw [realize_ex]
132
+ have actual input (ground : input ∈ M.sets) :
133
+ Realize M.sets (.conj (mainPrefixHistoryUnionFormula p.succ 0)
134
+ (BoundedFormula.pairMembershipFormula 0 y.succ g.succ).toFormula) (extend input env) ↔
135
+ MainPrefixHistoryUnionCode (env p) input ∧ ZFSet.pair input (env y) ∈ env g := by
136
+ change (_ ∧ _) ↔ _
137
+ rw [M.realize_mainPrefixHistoryUnionFormula _ _ _ (Fin.cases ground members),
138
+ BoundedFormula.realize_toFormula M _ _ (Fin.cases ground members),
139
+ BoundedFormula.truth_pairMembershipFormula]
140
+ rfl
141
+ constructor
142
+ · rintro ⟨input, ground, recognized⟩
143
+ exact ⟨input, (actual input ground).1 recognized⟩
144
+ · rintro ⟨input, union, entry⟩
145
+ have ground := M.pair_left (M.transitive (members g) entry)
146
+ exact ⟨input, ground, (actual input ground).2 ⟨union, entry⟩⟩
147
+
148
+ theorem realize_mainPrefixTraceStepFormula {n} (B seed g α p y : Fin n)
149
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
150
+ Realize M.sets (mainPrefixTraceStepFormula B seed g α p y) env ↔
151
+ MainPrefixTraceStepCode (env B) (env seed) (env g) (env α) (env p) (env y) := by
152
+ unfold mainPrefixTraceStepFormula MainPrefixTraceStepCode
153
+ change (_ ∧ _ ∧ _ ∧ _) ↔ _
154
+ rw [M.realize_mainPrefixAtSuccessorFormula _ _ _ members,
155
+ M.realize_mainPrefixHistoryExtendsFormula _ _ _ members,
156
+ M.realize_mainPrefixTraceBranchFormula _ _ _ _ _ _ members]
157
+ rfl
158
+
159
+ end TransitiveGround
160
+ end PartitionPilot.Forcing
161
+
162
+ end
163
+
164
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/MainPrefixValidityFormulas.lean CHANGED
@@ -1,241 +1,241 @@
1
- import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundLinkedMainStageLevels
2
-
3
- namespace OAI
4
-
5
- namespace PartitionPilot.Forcing
6
- open SetFormula
7
- universe u
8
- namespace BoundedFormula
9
-
10
- def pairedTransitionEntryFormula {n} (i j p a E : Fin n) : BoundedFormula n :=
11
- exMem E (exMem 0 (exMem 0 (.conj
12
- (orderedPairFormula 0 p.succ.succ.succ a.succ.succ.succ)
13
- (orderedTripleFormula 2 j.succ.succ.succ i.succ.succ.succ 0))))
14
-
15
- theorem truth_pairedTransitionEntryFormula {n} (i j p a E : Fin n)
16
- (env : Fin n → ZFSet.{u}) :
17
- Truth (pairedTransitionEntryFormula i j p a E) env ↔
18
- ZFSet.pair (ZFSet.pair (env j) (env i)) (ZFSet.pair (env p) (env a)) ∈ env E := by
19
- simp only [pairedTransitionEntryFormula, truth_exMem, Truth,
20
- truth_orderedPairFormula, truth_orderedTripleFormula]
21
- change (∃ w ∈ env E, ∃ b ∈ w, ∃ c ∈ b, c = ZFSet.pair (env p) (env a) ∧
22
- w = ZFSet.pair (ZFSet.pair (env j) (env i)) c) ↔ _
23
- constructor
24
- · rintro ⟨w, hw, b, _, c, _, rfl, rfl⟩
25
- exact hw
26
- · intro entry
27
- refine ⟨_, entry, {ZFSet.pair (env j) (env i), ZFSet.pair (env p) (env a)},
28
- ZFSet.mem_pair.2 (Or.inr rfl), _, ZFSet.mem_pair.2 (Or.inr rfl), rfl, rfl⟩
29
-
30
- end BoundedFormula
31
-
32
- namespace SetFormula
33
-
34
- def mainPrefixIdentityFormula {n} (E : Fin n) : SetFormula n :=
35
- let v := prefixIndex n 3
36
- allBlock 3 (BoundedFormula.imp
37
- (BoundedFormula.pairedTransitionEntryFormula (v 0) (v 0) (v 1) (v 2) (suffixIndex n 3 E))
38
- (.conj (BoundedFormula.graphDiagonalFormula (v 1))
39
- (BoundedFormula.graphDiagonalFormula (v 2)))).toFormula
40
-
41
- def mainPrefixCompositionFormula {n} (E : Fin n) : SetFormula n :=
42
- let v := prefixIndex n 9
43
- let old := suffixIndex n 9 E
44
- allBlock 9 (BoundedFormula.imp
45
- (BoundedFormula.pairedTransitionEntryFormula (v 0) (v 1) (v 3) (v 4) old)
46
- (BoundedFormula.imp
47
- (BoundedFormula.pairedTransitionEntryFormula (v 1) (v 2) (v 5) (v 6) old)
48
- (BoundedFormula.imp
49
- (BoundedFormula.pairedTransitionEntryFormula (v 0) (v 2) (v 7) (v 8) old)
50
- (.conj (BoundedFormula.graphCompositionFormula (v 3) (v 5) (v 7))
51
- (BoundedFormula.graphCompositionFormula (v 4) (v 6) (v 8)))))).toFormula
52
-
53
- end SetFormula
54
-
55
- namespace TransitiveGround
56
- variable (M : TransitiveGround.{u})
57
-
58
- theorem realize_mainPrefixIdentityFormula {n} (E : Fin n) (env : Fin n → ZFSet.{u})
59
- (members : ∀ j, env j ∈ M.sets) :
60
- Realize M.sets (mainPrefixIdentityFormula E) env ↔
61
- ∀ i p a, ZFSet.pair (ZFSet.pair i i) (ZFSet.pair p a) ∈ env E →
62
- GraphDiagonalCode p ∧ GraphDiagonalCode a := by
63
- rw [mainPrefixIdentityFormula, realize_allBlock]
64
- have actual (fields : Fin 3 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) :=
65
- BoundedFormula.realize_toFormula M
66
- (BoundedFormula.imp
67
- (BoundedFormula.pairedTransitionEntryFormula (prefixIndex n 3 0) (prefixIndex n 3 0)
68
- (prefixIndex n 3 1) (prefixIndex n 3 2) (suffixIndex n 3 E))
69
- (.conj (BoundedFormula.graphDiagonalFormula (prefixIndex n 3 1))
70
- (BoundedFormula.graphDiagonalFormula (prefixIndex n 3 2))))
71
- (extendMany 3 fields env) (extendMany_members 3 fields env ground members)
72
- simp only [BoundedFormula.truth_imp, BoundedFormula.Truth,
73
- BoundedFormula.truth_pairedTransitionEntryFormula, BoundedFormula.truth_graphDiagonalFormula,
74
- extendMany_prefix, extendMany_suffix] at actual
75
- constructor
76
- · intro recognized i p a entry
77
- have hg := M.transitive (members E) entry
78
- let fields : Fin 3 → ZFSet.{u} := Fin.cases i (Fin.cases p (fun _ => a))
79
- have ground : ∀ j, fields j ∈ M.sets := Fin.cases (M.pair_left (M.pair_left hg))
80
- (Fin.cases (M.pair_left (M.pair_right hg)) (fun _ => M.pair_right (M.pair_right hg)))
81
- exact (actual fields ground).1 (recognized fields ground) entry
82
- · intro law fields ground
83
- exact (actual fields ground).2 (law (fields 0) (fields 1) (fields 2))
84
-
85
- theorem realize_mainPrefixCompositionFormula {n} (E : Fin n) (env : Fin n → ZFSet.{u})
86
- (members : ∀ j, env j ∈ M.sets) :
87
- Realize M.sets (mainPrefixCompositionFormula E) env ↔
88
- ∀ i j k p₁ a₁ p₂ a₂ p₃ a₃,
89
- ZFSet.pair (ZFSet.pair j i) (ZFSet.pair p₁ a₁) ∈ env E →
90
- ZFSet.pair (ZFSet.pair k j) (ZFSet.pair p₂ a₂) ∈ env E →
91
- ZFSet.pair (ZFSet.pair k i) (ZFSet.pair p₃ a₃) ∈ env E →
92
- GraphCompositionCode p₁ p₂ p₃ ∧ GraphCompositionCode a₁ a₂ a₃ := by
93
- rw [mainPrefixCompositionFormula, realize_allBlock]
94
- have actual (fields : Fin 9 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) :=
95
- BoundedFormula.realize_toFormula M
96
- (BoundedFormula.imp
97
- (BoundedFormula.pairedTransitionEntryFormula (prefixIndex n 9 0) (prefixIndex n 9 1)
98
- (prefixIndex n 9 3) (prefixIndex n 9 4) (suffixIndex n 9 E))
99
- (BoundedFormula.imp
100
- (BoundedFormula.pairedTransitionEntryFormula (prefixIndex n 9 1) (prefixIndex n 9 2)
101
- (prefixIndex n 9 5) (prefixIndex n 9 6) (suffixIndex n 9 E))
102
- (BoundedFormula.imp
103
- (BoundedFormula.pairedTransitionEntryFormula (prefixIndex n 9 0) (prefixIndex n 9 2)
104
- (prefixIndex n 9 7) (prefixIndex n 9 8) (suffixIndex n 9 E))
105
- (.conj (BoundedFormula.graphCompositionFormula (prefixIndex n 9 3) (prefixIndex n 9 5) (prefixIndex n 9 7))
106
- (BoundedFormula.graphCompositionFormula (prefixIndex n 9 4) (prefixIndex n 9 6) (prefixIndex n 9 8))))))
107
- (extendMany 9 fields env) (extendMany_members 9 fields env ground members)
108
- simp only [BoundedFormula.truth_imp, BoundedFormula.Truth,
109
- BoundedFormula.truth_pairedTransitionEntryFormula, BoundedFormula.truth_graphCompositionFormula,
110
- extendMany_prefix, extendMany_suffix] at actual
111
- constructor
112
- · intro recognized i j k p₁ a₁ p₂ a₂ p₃ a₃ first second third
113
- have h₁ := M.transitive (members E) first
114
- have h₂ := M.transitive (members E) second
115
- have h₃ := M.transitive (members E) third
116
- let fields : Fin 9 → ZFSet.{u} := Fin.cases i (Fin.cases j (Fin.cases k (Fin.cases p₁
117
- (Fin.cases a₁ (Fin.cases p₂ (Fin.cases a₂ (Fin.cases p₃ (fun _ => a₃))))))))
118
- have ground : ∀ a, fields a ∈ M.sets := Fin.cases (M.pair_right (M.pair_left h₁))
119
- (Fin.cases (M.pair_left (M.pair_left h₁)) (Fin.cases (M.pair_left (M.pair_left h₂))
120
- (Fin.cases (M.pair_left (M.pair_right h₁)) (Fin.cases (M.pair_right (M.pair_right h₁))
121
- (Fin.cases (M.pair_left (M.pair_right h₂)) (Fin.cases (M.pair_right (M.pair_right h₂))
122
- (Fin.cases (M.pair_left (M.pair_right h₃)) (fun _ => M.pair_right (M.pair_right h₃)))))))))
123
- exact (actual fields ground).1 (recognized fields ground) first second third
124
- · intro law fields ground
125
- exact (actual fields ground).2 (law (fields 0) (fields 1) (fields 2) (fields 3)
126
- (fields 4) (fields 5) (fields 6) (fields 7) (fields 8))
127
-
128
- end TransitiveGround
129
-
130
- namespace SetFormula
131
-
132
- def mainPrefixStagesFormula {n} (K Labels C D rD N S : Fin n) : SetFormula n :=
133
- let old := suffixIndex n 2
134
- let v := prefixIndex n 2
135
- allBlock 2 (imp (BoundedFormula.pairMembershipFormula (v 0) (v 1) (old S)).toFormula
136
- (linkedMainStageFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) (v 1)))
137
-
138
- def mainPrefixTransitionsFormula {n} (K Labels C D rD N S E : Fin n) : SetFormula n :=
139
- let old := suffixIndex n 5
140
- let v := prefixIndex n 5
141
- allBlock 5 (imp (BoundedFormula.conj
142
- (BoundedFormula.pairMembershipFormula (v 0) (v 2) (old S))
143
- (.conj (BoundedFormula.pairMembershipFormula (v 1) (v 3) (old S))
144
- (BoundedFormula.tripleMembershipFormula (v 1) (v 0) (v 4) (old E)))).toFormula
145
- (linkedMainTransitionFormula (old K) (old Labels) (old C) (old D) (old rD) (old N)
146
- (v 2) (v 3) (v 4)))
147
-
148
- end SetFormula
149
-
150
- namespace TransitiveGround
151
- variable (M : TransitiveGround.{u})
152
- variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
153
- variable (unions : Realize M.sets SetFormula.union Fin.elim0)
154
- variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
155
- variable (collection : CollectionSchema M.sets)
156
- include pairing unions powers separation collection
157
-
158
- theorem realize_mainPrefixStagesFormula {n} (K Labels C D rD N S : Fin n)
159
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
160
- (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) :
161
- Realize M.sets (mainPrefixStagesFormula K Labels C D rD N S) env ↔
162
- ∀ i a, ZFSet.pair i a ∈ env S →
163
- ∃ linked : GroundLinkedMainStage M (env K) (env Labels) (env C) (env D) (env rD),
164
- linked.code = a := by
165
- rw [mainPrefixStagesFormula, realize_allBlock]
166
- have actual (fields : Fin 2 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) :
167
- Realize M.sets
168
- (imp (BoundedFormula.pairMembershipFormula (prefixIndex n 2 0) (prefixIndex n 2 1)
169
- (suffixIndex n 2 S)).toFormula
170
- (linkedMainStageFormula (suffixIndex n 2 K) (suffixIndex n 2 Labels)
171
- (suffixIndex n 2 C) (suffixIndex n 2 D) (suffixIndex n 2 rD)
172
- (suffixIndex n 2 N) (prefixIndex n 2 1))) (extendMany 2 fields env) ↔
173
- ZFSet.pair (fields 0) (fields 1) ∈ env S →
174
- ∃ linked : GroundLinkedMainStage M (env K) (env Labels) (env C) (env D) (env rD),
175
- linked.code = fields 1 := by
176
- rw [realize_imp, BoundedFormula.realize_toFormula M _ _
177
- (extendMany_members 2 fields env ground members), BoundedFormula.truth_pairMembershipFormula,
178
- M.realize_linkedMainStageFormula pairing unions powers separation collection _ _ _ _ _ _ _ _
179
- (extendMany_members 2 fields env ground members)
180
- (by simpa only [extendMany_suffix] using omega)
181
- (by simpa only [extendMany_suffix] using ordinal)]
182
- simp only [extendMany_prefix, extendMany_suffix]
183
- rfl
184
- constructor
185
- · intro recognized i a entry
186
- have hg := M.transitive (members S) entry
187
- let fields : Fin 2 → ZFSet.{u} := Fin.cases i (fun _ => a)
188
- have ground : ∀ j, fields j ∈ M.sets := Fin.cases (M.pair_left hg) (fun _ => M.pair_right hg)
189
- exact (actual fields ground).1 (recognized fields ground) entry
190
- · intro law fields ground
191
- exact (actual fields ground).2 (law (fields 0) (fields 1))
192
-
193
- theorem realize_mainPrefixTransitionsFormula {n} (K Labels C D rD N S E : Fin n)
194
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
195
- (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) :
196
- Realize M.sets (mainPrefixTransitionsFormula K Labels C D rD N S E) env ↔
197
- ∀ i j a b z, ZFSet.pair i a ∈ env S → ZFSet.pair j b ∈ env S →
198
- ZFSet.pair (ZFSet.pair j i) z ∈ env E →
199
- LinkedMainTransitionCode M (env K) (env Labels) (env C) (env D) (env rD) a b z := by
200
- rw [mainPrefixTransitionsFormula, realize_allBlock]
201
- have actual (fields : Fin 5 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) :
202
- Realize M.sets
203
- (imp (BoundedFormula.conj
204
- (BoundedFormula.pairMembershipFormula (prefixIndex n 5 0) (prefixIndex n 5 2) (suffixIndex n 5 S))
205
- (.conj (BoundedFormula.pairMembershipFormula (prefixIndex n 5 1) (prefixIndex n 5 3) (suffixIndex n 5 S))
206
- (BoundedFormula.tripleMembershipFormula (prefixIndex n 5 1) (prefixIndex n 5 0) (prefixIndex n 5 4)
207
- (suffixIndex n 5 E)))).toFormula
208
- (linkedMainTransitionFormula (suffixIndex n 5 K) (suffixIndex n 5 Labels) (suffixIndex n 5 C)
209
- (suffixIndex n 5 D) (suffixIndex n 5 rD) (suffixIndex n 5 N)
210
- (prefixIndex n 5 2) (prefixIndex n 5 3) (prefixIndex n 5 4))) (extendMany 5 fields env) ↔
211
- (ZFSet.pair (fields 0) (fields 2) ∈ env S ∧ ZFSet.pair (fields 1) (fields 3) ∈ env S ∧
212
- ZFSet.pair (ZFSet.pair (fields 1) (fields 0)) (fields 4) ∈ env E) →
213
- LinkedMainTransitionCode M (env K) (env Labels) (env C) (env D) (env rD)
214
- (fields 2) (fields 3) (fields 4) := by
215
- rw [realize_imp, BoundedFormula.realize_toFormula M _ _
216
- (extendMany_members 5 fields env ground members)]
217
- simp only [BoundedFormula.Truth, BoundedFormula.truth_pairMembershipFormula,
218
- BoundedFormula.truth_tripleMembershipFormula]
219
- rw [M.realize_linkedMainTransitionFormula pairing unions powers separation collection _ _ _ _ _ _ _ _ _ _
220
- (extendMany_members 5 fields env ground members)
221
- (by simpa only [extendMany_suffix] using omega)
222
- (by simpa only [extendMany_suffix] using ordinal)]
223
- simp only [extendMany_prefix, extendMany_suffix]
224
- constructor
225
- · intro recognized i j a b z first second third
226
- have h₁ := M.transitive (members S) first
227
- have h₂ := M.transitive (members S) second
228
- have h₃ := M.transitive (members E) third
229
- let fields : Fin 5 → ZFSet.{u} := Fin.cases i (Fin.cases j (Fin.cases a (Fin.cases b (fun _ => z))))
230
- have ground : ∀ k, fields k ∈ M.sets := Fin.cases (M.pair_left h₁)
231
- (Fin.cases (M.pair_left h₂) (Fin.cases (M.pair_right h₁)
232
- (Fin.cases (M.pair_right h₂) (fun _ => M.pair_right h₃))))
233
- exact (actual fields ground).1 (recognized fields ground) ⟨first, second, third⟩
234
- · intro law fields ground
235
- exact (actual fields ground).2 (fun entries =>
236
- law (fields 0) (fields 1) (fields 2) (fields 3) (fields 4) entries.1 entries.2.1 entries.2.2)
237
-
238
- end TransitiveGround
239
- end PartitionPilot.Forcing
240
-
241
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundLinkedMainStageLevels
2
+
3
+ namespace OAI
4
+
5
+ namespace PartitionPilot.Forcing
6
+ open SetFormula
7
+ universe u
8
+ namespace BoundedFormula
9
+
10
+ def pairedTransitionEntryFormula {n} (i j p a E : Fin n) : BoundedFormula n :=
11
+ exMem E (exMem 0 (exMem 0 (.conj
12
+ (orderedPairFormula 0 p.succ.succ.succ a.succ.succ.succ)
13
+ (orderedTripleFormula 2 j.succ.succ.succ i.succ.succ.succ 0))))
14
+
15
+ theorem truth_pairedTransitionEntryFormula {n} (i j p a E : Fin n)
16
+ (env : Fin n → ZFSet.{u}) :
17
+ Truth (pairedTransitionEntryFormula i j p a E) env ↔
18
+ ZFSet.pair (ZFSet.pair (env j) (env i)) (ZFSet.pair (env p) (env a)) ∈ env E := by
19
+ simp only [pairedTransitionEntryFormula, truth_exMem, Truth,
20
+ truth_orderedPairFormula, truth_orderedTripleFormula]
21
+ change (∃ w ∈ env E, ∃ b ∈ w, ∃ c ∈ b, c = ZFSet.pair (env p) (env a) ∧
22
+ w = ZFSet.pair (ZFSet.pair (env j) (env i)) c) ↔ _
23
+ constructor
24
+ · rintro ⟨w, hw, b, _, c, _, rfl, rfl⟩
25
+ exact hw
26
+ · intro entry
27
+ refine ⟨_, entry, {ZFSet.pair (env j) (env i), ZFSet.pair (env p) (env a)},
28
+ ZFSet.mem_pair.2 (Or.inr rfl), _, ZFSet.mem_pair.2 (Or.inr rfl), rfl, rfl⟩
29
+
30
+ end BoundedFormula
31
+
32
+ namespace SetFormula
33
+
34
+ def mainPrefixIdentityFormula {n} (E : Fin n) : SetFormula n :=
35
+ let v := prefixIndex n 3
36
+ allBlock 3 (BoundedFormula.imp
37
+ (BoundedFormula.pairedTransitionEntryFormula (v 0) (v 0) (v 1) (v 2) (suffixIndex n 3 E))
38
+ (.conj (BoundedFormula.graphDiagonalFormula (v 1))
39
+ (BoundedFormula.graphDiagonalFormula (v 2)))).toFormula
40
+
41
+ def mainPrefixCompositionFormula {n} (E : Fin n) : SetFormula n :=
42
+ let v := prefixIndex n 9
43
+ let old := suffixIndex n 9 E
44
+ allBlock 9 (BoundedFormula.imp
45
+ (BoundedFormula.pairedTransitionEntryFormula (v 0) (v 1) (v 3) (v 4) old)
46
+ (BoundedFormula.imp
47
+ (BoundedFormula.pairedTransitionEntryFormula (v 1) (v 2) (v 5) (v 6) old)
48
+ (BoundedFormula.imp
49
+ (BoundedFormula.pairedTransitionEntryFormula (v 0) (v 2) (v 7) (v 8) old)
50
+ (.conj (BoundedFormula.graphCompositionFormula (v 3) (v 5) (v 7))
51
+ (BoundedFormula.graphCompositionFormula (v 4) (v 6) (v 8)))))).toFormula
52
+
53
+ end SetFormula
54
+
55
+ namespace TransitiveGround
56
+ variable (M : TransitiveGround.{u})
57
+
58
+ theorem realize_mainPrefixIdentityFormula {n} (E : Fin n) (env : Fin n → ZFSet.{u})
59
+ (members : ∀ j, env j ∈ M.sets) :
60
+ Realize M.sets (mainPrefixIdentityFormula E) env ↔
61
+ ∀ i p a, ZFSet.pair (ZFSet.pair i i) (ZFSet.pair p a) ∈ env E →
62
+ GraphDiagonalCode p ∧ GraphDiagonalCode a := by
63
+ rw [mainPrefixIdentityFormula, realize_allBlock]
64
+ have actual (fields : Fin 3 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) :=
65
+ BoundedFormula.realize_toFormula M
66
+ (BoundedFormula.imp
67
+ (BoundedFormula.pairedTransitionEntryFormula (prefixIndex n 3 0) (prefixIndex n 3 0)
68
+ (prefixIndex n 3 1) (prefixIndex n 3 2) (suffixIndex n 3 E))
69
+ (.conj (BoundedFormula.graphDiagonalFormula (prefixIndex n 3 1))
70
+ (BoundedFormula.graphDiagonalFormula (prefixIndex n 3 2))))
71
+ (extendMany 3 fields env) (extendMany_members 3 fields env ground members)
72
+ simp only [BoundedFormula.truth_imp, BoundedFormula.Truth,
73
+ BoundedFormula.truth_pairedTransitionEntryFormula, BoundedFormula.truth_graphDiagonalFormula,
74
+ extendMany_prefix, extendMany_suffix] at actual
75
+ constructor
76
+ · intro recognized i p a entry
77
+ have hg := M.transitive (members E) entry
78
+ let fields : Fin 3 → ZFSet.{u} := Fin.cases i (Fin.cases p (fun _ => a))
79
+ have ground : ∀ j, fields j ∈ M.sets := Fin.cases (M.pair_left (M.pair_left hg))
80
+ (Fin.cases (M.pair_left (M.pair_right hg)) (fun _ => M.pair_right (M.pair_right hg)))
81
+ exact (actual fields ground).1 (recognized fields ground) entry
82
+ · intro law fields ground
83
+ exact (actual fields ground).2 (law (fields 0) (fields 1) (fields 2))
84
+
85
+ theorem realize_mainPrefixCompositionFormula {n} (E : Fin n) (env : Fin n → ZFSet.{u})
86
+ (members : ∀ j, env j ∈ M.sets) :
87
+ Realize M.sets (mainPrefixCompositionFormula E) env ↔
88
+ ∀ i j k p₁ a₁ p₂ a₂ p₃ a₃,
89
+ ZFSet.pair (ZFSet.pair j i) (ZFSet.pair p₁ a₁) ∈ env E →
90
+ ZFSet.pair (ZFSet.pair k j) (ZFSet.pair p₂ a₂) ∈ env E →
91
+ ZFSet.pair (ZFSet.pair k i) (ZFSet.pair p₃ a₃) ∈ env E →
92
+ GraphCompositionCode p₁ p₂ p₃ ∧ GraphCompositionCode a₁ a₂ a₃ := by
93
+ rw [mainPrefixCompositionFormula, realize_allBlock]
94
+ have actual (fields : Fin 9 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) :=
95
+ BoundedFormula.realize_toFormula M
96
+ (BoundedFormula.imp
97
+ (BoundedFormula.pairedTransitionEntryFormula (prefixIndex n 9 0) (prefixIndex n 9 1)
98
+ (prefixIndex n 9 3) (prefixIndex n 9 4) (suffixIndex n 9 E))
99
+ (BoundedFormula.imp
100
+ (BoundedFormula.pairedTransitionEntryFormula (prefixIndex n 9 1) (prefixIndex n 9 2)
101
+ (prefixIndex n 9 5) (prefixIndex n 9 6) (suffixIndex n 9 E))
102
+ (BoundedFormula.imp
103
+ (BoundedFormula.pairedTransitionEntryFormula (prefixIndex n 9 0) (prefixIndex n 9 2)
104
+ (prefixIndex n 9 7) (prefixIndex n 9 8) (suffixIndex n 9 E))
105
+ (.conj (BoundedFormula.graphCompositionFormula (prefixIndex n 9 3) (prefixIndex n 9 5) (prefixIndex n 9 7))
106
+ (BoundedFormula.graphCompositionFormula (prefixIndex n 9 4) (prefixIndex n 9 6) (prefixIndex n 9 8))))))
107
+ (extendMany 9 fields env) (extendMany_members 9 fields env ground members)
108
+ simp only [BoundedFormula.truth_imp, BoundedFormula.Truth,
109
+ BoundedFormula.truth_pairedTransitionEntryFormula, BoundedFormula.truth_graphCompositionFormula,
110
+ extendMany_prefix, extendMany_suffix] at actual
111
+ constructor
112
+ · intro recognized i j k p₁ a₁ p₂ a₂ p₃ a₃ first second third
113
+ have h₁ := M.transitive (members E) first
114
+ have h₂ := M.transitive (members E) second
115
+ have h₃ := M.transitive (members E) third
116
+ let fields : Fin 9 → ZFSet.{u} := Fin.cases i (Fin.cases j (Fin.cases k (Fin.cases p₁
117
+ (Fin.cases a₁ (Fin.cases p₂ (Fin.cases a₂ (Fin.cases p₃ (fun _ => a₃))))))))
118
+ have ground : ∀ a, fields a ∈ M.sets := Fin.cases (M.pair_right (M.pair_left h₁))
119
+ (Fin.cases (M.pair_left (M.pair_left h₁)) (Fin.cases (M.pair_left (M.pair_left h₂))
120
+ (Fin.cases (M.pair_left (M.pair_right h₁)) (Fin.cases (M.pair_right (M.pair_right h₁))
121
+ (Fin.cases (M.pair_left (M.pair_right h₂)) (Fin.cases (M.pair_right (M.pair_right h₂))
122
+ (Fin.cases (M.pair_left (M.pair_right h₃)) (fun _ => M.pair_right (M.pair_right h₃)))))))))
123
+ exact (actual fields ground).1 (recognized fields ground) first second third
124
+ · intro law fields ground
125
+ exact (actual fields ground).2 (law (fields 0) (fields 1) (fields 2) (fields 3)
126
+ (fields 4) (fields 5) (fields 6) (fields 7) (fields 8))
127
+
128
+ end TransitiveGround
129
+
130
+ namespace SetFormula
131
+
132
+ def mainPrefixStagesFormula {n} (K Labels C D rD N S : Fin n) : SetFormula n :=
133
+ let old := suffixIndex n 2
134
+ let v := prefixIndex n 2
135
+ allBlock 2 (imp (BoundedFormula.pairMembershipFormula (v 0) (v 1) (old S)).toFormula
136
+ (linkedMainStageFormula (old K) (old Labels) (old C) (old D) (old rD) (old N) (v 1)))
137
+
138
+ def mainPrefixTransitionsFormula {n} (K Labels C D rD N S E : Fin n) : SetFormula n :=
139
+ let old := suffixIndex n 5
140
+ let v := prefixIndex n 5
141
+ allBlock 5 (imp (BoundedFormula.conj
142
+ (BoundedFormula.pairMembershipFormula (v 0) (v 2) (old S))
143
+ (.conj (BoundedFormula.pairMembershipFormula (v 1) (v 3) (old S))
144
+ (BoundedFormula.tripleMembershipFormula (v 1) (v 0) (v 4) (old E)))).toFormula
145
+ (linkedMainTransitionFormula (old K) (old Labels) (old C) (old D) (old rD) (old N)
146
+ (v 2) (v 3) (v 4)))
147
+
148
+ end SetFormula
149
+
150
+ namespace TransitiveGround
151
+ variable (M : TransitiveGround.{u})
152
+ variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
153
+ variable (unions : Realize M.sets SetFormula.union Fin.elim0)
154
+ variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
155
+ variable (collection : CollectionSchema M.sets)
156
+ include pairing unions powers separation collection
157
+
158
+ theorem realize_mainPrefixStagesFormula {n} (K Labels C D rD N S : Fin n)
159
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
160
+ (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) :
161
+ Realize M.sets (mainPrefixStagesFormula K Labels C D rD N S) env ↔
162
+ ∀ i a, ZFSet.pair i a ∈ env S →
163
+ ∃ linked : GroundLinkedMainStage M (env K) (env Labels) (env C) (env D) (env rD),
164
+ linked.code = a := by
165
+ rw [mainPrefixStagesFormula, realize_allBlock]
166
+ have actual (fields : Fin 2 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) :
167
+ Realize M.sets
168
+ (imp (BoundedFormula.pairMembershipFormula (prefixIndex n 2 0) (prefixIndex n 2 1)
169
+ (suffixIndex n 2 S)).toFormula
170
+ (linkedMainStageFormula (suffixIndex n 2 K) (suffixIndex n 2 Labels)
171
+ (suffixIndex n 2 C) (suffixIndex n 2 D) (suffixIndex n 2 rD)
172
+ (suffixIndex n 2 N) (prefixIndex n 2 1))) (extendMany 2 fields env) ↔
173
+ ZFSet.pair (fields 0) (fields 1) ∈ env S →
174
+ ∃ linked : GroundLinkedMainStage M (env K) (env Labels) (env C) (env D) (env rD),
175
+ linked.code = fields 1 := by
176
+ rw [realize_imp, BoundedFormula.realize_toFormula M _ _
177
+ (extendMany_members 2 fields env ground members), BoundedFormula.truth_pairMembershipFormula,
178
+ M.realize_linkedMainStageFormula pairing unions powers separation collection _ _ _ _ _ _ _ _
179
+ (extendMany_members 2 fields env ground members)
180
+ (by simpa only [extendMany_suffix] using omega)
181
+ (by simpa only [extendMany_suffix] using ordinal)]
182
+ simp only [extendMany_prefix, extendMany_suffix]
183
+ rfl
184
+ constructor
185
+ · intro recognized i a entry
186
+ have hg := M.transitive (members S) entry
187
+ let fields : Fin 2 → ZFSet.{u} := Fin.cases i (fun _ => a)
188
+ have ground : ∀ j, fields j ∈ M.sets := Fin.cases (M.pair_left hg) (fun _ => M.pair_right hg)
189
+ exact (actual fields ground).1 (recognized fields ground) entry
190
+ · intro law fields ground
191
+ exact (actual fields ground).2 (law (fields 0) (fields 1))
192
+
193
+ theorem realize_mainPrefixTransitionsFormula {n} (K Labels C D rD N S E : Fin n)
194
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
195
+ (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) :
196
+ Realize M.sets (mainPrefixTransitionsFormula K Labels C D rD N S E) env ↔
197
+ ∀ i j a b z, ZFSet.pair i a ∈ env S → ZFSet.pair j b ∈ env S →
198
+ ZFSet.pair (ZFSet.pair j i) z ∈ env E →
199
+ LinkedMainTransitionCode M (env K) (env Labels) (env C) (env D) (env rD) a b z := by
200
+ rw [mainPrefixTransitionsFormula, realize_allBlock]
201
+ have actual (fields : Fin 5 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) :
202
+ Realize M.sets
203
+ (imp (BoundedFormula.conj
204
+ (BoundedFormula.pairMembershipFormula (prefixIndex n 5 0) (prefixIndex n 5 2) (suffixIndex n 5 S))
205
+ (.conj (BoundedFormula.pairMembershipFormula (prefixIndex n 5 1) (prefixIndex n 5 3) (suffixIndex n 5 S))
206
+ (BoundedFormula.tripleMembershipFormula (prefixIndex n 5 1) (prefixIndex n 5 0) (prefixIndex n 5 4)
207
+ (suffixIndex n 5 E)))).toFormula
208
+ (linkedMainTransitionFormula (suffixIndex n 5 K) (suffixIndex n 5 Labels) (suffixIndex n 5 C)
209
+ (suffixIndex n 5 D) (suffixIndex n 5 rD) (suffixIndex n 5 N)
210
+ (prefixIndex n 5 2) (prefixIndex n 5 3) (prefixIndex n 5 4))) (extendMany 5 fields env) ↔
211
+ (ZFSet.pair (fields 0) (fields 2) ∈ env S ∧ ZFSet.pair (fields 1) (fields 3) ∈ env S ∧
212
+ ZFSet.pair (ZFSet.pair (fields 1) (fields 0)) (fields 4) ∈ env E) →
213
+ LinkedMainTransitionCode M (env K) (env Labels) (env C) (env D) (env rD)
214
+ (fields 2) (fields 3) (fields 4) := by
215
+ rw [realize_imp, BoundedFormula.realize_toFormula M _ _
216
+ (extendMany_members 5 fields env ground members)]
217
+ simp only [BoundedFormula.Truth, BoundedFormula.truth_pairMembershipFormula,
218
+ BoundedFormula.truth_tripleMembershipFormula]
219
+ rw [M.realize_linkedMainTransitionFormula pairing unions powers separation collection _ _ _ _ _ _ _ _ _ _
220
+ (extendMany_members 5 fields env ground members)
221
+ (by simpa only [extendMany_suffix] using omega)
222
+ (by simpa only [extendMany_suffix] using ordinal)]
223
+ simp only [extendMany_prefix, extendMany_suffix]
224
+ constructor
225
+ · intro recognized i j a b z first second third
226
+ have h₁ := M.transitive (members S) first
227
+ have h₂ := M.transitive (members S) second
228
+ have h₃ := M.transitive (members E) third
229
+ let fields : Fin 5 → ZFSet.{u} := Fin.cases i (Fin.cases j (Fin.cases a (Fin.cases b (fun _ => z))))
230
+ have ground : ∀ k, fields k ∈ M.sets := Fin.cases (M.pair_left h₁)
231
+ (Fin.cases (M.pair_left h₂) (Fin.cases (M.pair_right h₁)
232
+ (Fin.cases (M.pair_right h₂) (fun _ => M.pair_right h₃))))
233
+ exact (actual fields ground).1 (recognized fields ground) ⟨first, second, third⟩
234
+ · intro law fields ground
235
+ exact (actual fields ground).2 (fun entries =>
236
+ law (fields 0) (fields 1) (fields 2) (fields 3) (fields 4) entries.1 entries.2.1 entries.2.2)
237
+
238
+ end TransitiveGround
239
+ end PartitionPilot.Forcing
240
+
241
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/MainTransitionValidityCodes.lean CHANGED
@@ -1,131 +1,131 @@
1
- import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainTransitionLaws
2
- import OAI.SetTheory.PartitionPrinciple.Geometry.RectangleFulfillmentAtBound
3
-
4
- namespace OAI
5
-
6
- section
7
-
8
- namespace PartitionPilot.Forcing
9
- open SetFormula
10
- universe u
11
-
12
- structure MainTransitionLaws
13
- (P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : ZFSet.{u}) : Prop where
14
- point_embedding : MeetEmbeddingCode P Q rP rQ μP μQ points
15
- order_iff : ∀ x y x' y', ZFSet.pair x x' ∈ points → ZFSet.pair y y' ∈ points →
16
- (ZFSet.pair x' y' ∈ rQ ↔ ZFSet.pair x y ∈ rP)
17
- group_embedding : GroupEmbeddingCode G H mG mH oneG oneH actors
18
- equivariant : ∀ g g' x y x' y', ZFSet.pair g g' ∈ actors →
19
- ZFSet.pair x x' ∈ points → ZFSet.pair y y' ∈ points →
20
- ZFSet.pair (ZFSet.pair g x) y ∈ AP → ZFSet.pair (ZFSet.pair g' x') y' ∈ AQ
21
- bottom : ZFSet.pair bP bQ ∈ points
22
- height : ∀ x y z, ZFSet.pair x y ∈ points →
23
- (ZFSet.pair y z ∈ heightQ ↔ ZFSet.pair x z ∈ heightP)
24
- agreement : ∀ g h g' h' v v', ZFSet.pair g g' ∈ actors → ZFSet.pair h h' ∈ actors →
25
- ZFSet.pair v v' ∈ points → ActionAgreementBelow P rP AP g h v →
26
- ActionAgreementBelow Q rQ AQ g' h' v'
27
-
28
- namespace BoundedFormula
29
-
30
- def transitionOrderFormula {n} (P Q rP rQ points : Fin n) : BoundedFormula n :=
31
- let lift (i : Fin n) := i.succ.succ.succ.succ
32
- .allMem P (.allMem P.succ (.allMem Q.succ.succ (.allMem Q.succ.succ.succ
33
- (imp (.conj (pairMembershipFormula 3 1 (lift points)) (pairMembershipFormula 2 0 (lift points)))
34
- (.conj (imp (pairMembershipFormula 1 0 (lift rQ)) (pairMembershipFormula 3 2 (lift rP)))
35
- (imp (pairMembershipFormula 3 2 (lift rP)) (pairMembershipFormula 1 0 (lift rQ))))))))
36
-
37
- def transitionEquivarianceFormula {n} (P Q G H AP AQ points actors : Fin n) : BoundedFormula n :=
38
- let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ
39
- .allMem G (.allMem H.succ (.allMem P.succ.succ (.allMem P.succ.succ.succ
40
- (.allMem Q.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ
41
- (imp (.conj (pairMembershipFormula 5 4 (lift actors))
42
- (.conj (pairMembershipFormula 3 1 (lift points))
43
- (.conj (pairMembershipFormula 2 0 (lift points))
44
- (tripleMembershipFormula 5 3 2 (lift AP)))))
45
- (tripleMembershipFormula 4 1 0 (lift AQ))))))))
46
-
47
- def transitionHeightFormula {n} (P Q heightP heightQ points : Fin n) : BoundedFormula n :=
48
- .allMem P (.allMem Q.succ (imp (pairMembershipFormula 1 0 points.succ.succ)
49
- (graphFiberEqualityFormula 0 1 heightQ.succ.succ heightP.succ.succ)))
50
-
51
- def transitionAgreementFormula {n} (P Q rP rQ G H AP AQ points actors : Fin n) : BoundedFormula n :=
52
- let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ
53
- .allMem G (.allMem G.succ (.allMem H.succ.succ (.allMem H.succ.succ.succ
54
- (.allMem P.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ
55
- (imp (.conj (pairMembershipFormula 5 3 (lift actors))
56
- (.conj (pairMembershipFormula 4 2 (lift actors))
57
- (.conj (pairMembershipFormula 1 0 (lift points))
58
- (actionAgreementBelowFormula (lift P) (lift rP) (lift AP) 5 4 1))))
59
- (actionAgreementBelowFormula (lift Q) (lift rQ) (lift AQ) 3 2 0)))))))
60
-
61
- def mainTransitionLawsFormula {n}
62
- (P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n) :
63
- BoundedFormula n :=
64
- .conj (meetEmbeddingFormula P Q rP rQ μP μQ points)
65
- (.conj (transitionOrderFormula P Q rP rQ points)
66
- (.conj (groupEmbeddingFormula G H mG mH oneG oneH actors)
67
- (.conj (transitionEquivarianceFormula P Q G H AP AQ points actors)
68
- (.conj (pairMembershipFormula bP bQ points)
69
- (.conj (transitionHeightFormula P Q heightP heightQ points)
70
- (transitionAgreementFormula P Q rP rQ G H AP AQ points actors))))))
71
-
72
- theorem truth_mainTransitionLawsFormula {n}
73
- (P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n)
74
- (env : Fin n → ZFSet.{u}) :
75
- Truth (mainTransitionLawsFormula P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ
76
- heightP heightQ points actors) env ↔
77
- MainTransitionLaws (env P) (env Q) (env rP) (env rQ) (env μP) (env μQ) (env G) (env H)
78
- (env mG) (env mH) (env oneG) (env oneH) (env AP) (env AQ) (env bP) (env bQ)
79
- (env heightP) (env heightQ) (env points) (env actors) := by
80
- simp only [mainTransitionLawsFormula, transitionOrderFormula, transitionEquivarianceFormula,
81
- transitionHeightFormula, transitionAgreementFormula, Truth, truth_meetEmbeddingFormula,
82
- truth_groupEmbeddingFormula, truth_imp, truth_pairMembershipFormula,
83
- truth_tripleMembershipFormula, truth_graphFiberEqualityFormula, truth_actionAgreementBelowFormula]
84
- constructor
85
- · rintro ⟨point, order, group, equivariant, bottom, height, agreement⟩
86
- have pb {x y : ZFSet.{u}} (entry : ZFSet.pair x y ∈ env points) : x ∈ env P ∧ y ∈ env Q :=
87
- ZFSet.pair_mem_prod.1 (point.injection.function.1 entry)
88
- have ab {x y : ZFSet.{u}} (entry : ZFSet.pair x y ∈ env actors) : x ∈ env G ∧ y ∈ env H :=
89
- ZFSet.pair_mem_prod.1 (group.injection.function.1 entry)
90
- refine ⟨point, ?_, group, ?_, bottom, ?_, ?_⟩
91
- · intro x y x' y' xx yy
92
- have h := order x (pb xx).1 y (pb yy).1 x' (pb xx).2 y' (pb yy).2 ⟨xx, yy⟩
93
- exact ⟨h.1, h.2⟩
94
- · intro g g' x y x' y' gg xx yy act
95
- exact equivariant g (ab gg).1 g' (ab gg).2 x (pb xx).1 y (pb yy).1
96
- x' (pb xx).2 y' (pb yy).2 ⟨gg, xx, yy, act⟩
97
- · intro x y z entry
98
- exact height x (pb entry).1 y (pb entry).2 entry z
99
- · intro g h g' h' v v' gg hh vv agree
100
- exact agreement g (ab gg).1 h (ab hh).1 g' (ab gg).2 h' (ab hh).2
101
- v (pb vv).1 v' (pb vv).2 ⟨gg, hh, vv, agree⟩
102
- · intro code
103
- refine ⟨code.point_embedding, ?_, code.group_embedding, ?_, code.bottom, ?_, ?_⟩
104
- · intro x _ y _ x' _ y' _ h
105
- exact ⟨(code.order_iff x y x' y' h.1 h.2).1, (code.order_iff x y x' y' h.1 h.2).2⟩
106
- · intro g _ g' _ x _ y _ x' _ y' _ h
107
- exact code.equivariant g g' x y x' y' h.1 h.2.1 h.2.2.1 h.2.2.2
108
- · intro x _ y _ entry z
109
- exact code.height x y z entry
110
- · intro g _ h _ g' _ h' _ v _ v' _ entries
111
- exact code.agreement g h g' h' v v' entries.1 entries.2.1 entries.2.2.1 entries.2.2.2
112
-
113
- theorem realize_mainTransitionLawsFormula (M : TransitiveGround.{u}) {n}
114
- (P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n)
115
- (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) :
116
- Realize M.sets (mainTransitionLawsFormula P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ
117
- heightP heightQ points actors).toFormula env ↔
118
- MainTransitionLaws (env P) (env Q) (env rP) (env rQ) (env μP) (env μQ) (env G) (env H)
119
- (env mG) (env mH) (env oneG) (env oneH) (env AP) (env AQ) (env bP) (env bQ)
120
- (env heightP) (env heightQ) (env points) (env actors) :=
121
- (realize_toFormula M _ env members).trans
122
- (truth_mainTransitionLawsFormula P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ
123
- heightP heightQ points actors env)
124
-
125
- end BoundedFormula
126
-
127
- end PartitionPilot.Forcing
128
-
129
- end
130
-
131
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Geometry.GroundMainTransitionLaws
2
+ import OAI.SetTheory.PartitionPrinciple.Geometry.RectangleFulfillmentAtBound
3
+
4
+ namespace OAI
5
+
6
+ section
7
+
8
+ namespace PartitionPilot.Forcing
9
+ open SetFormula
10
+ universe u
11
+
12
+ structure MainTransitionLaws
13
+ (P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : ZFSet.{u}) : Prop where
14
+ point_embedding : MeetEmbeddingCode P Q rP rQ μP μQ points
15
+ order_iff : ∀ x y x' y', ZFSet.pair x x' ∈ points → ZFSet.pair y y' ∈ points →
16
+ (ZFSet.pair x' y' ∈ rQ ↔ ZFSet.pair x y ∈ rP)
17
+ group_embedding : GroupEmbeddingCode G H mG mH oneG oneH actors
18
+ equivariant : ∀ g g' x y x' y', ZFSet.pair g g' ∈ actors →
19
+ ZFSet.pair x x' ∈ points → ZFSet.pair y y' ∈ points →
20
+ ZFSet.pair (ZFSet.pair g x) y ∈ AP → ZFSet.pair (ZFSet.pair g' x') y' ∈ AQ
21
+ bottom : ZFSet.pair bP bQ ∈ points
22
+ height : ∀ x y z, ZFSet.pair x y ∈ points →
23
+ (ZFSet.pair y z ∈ heightQ ↔ ZFSet.pair x z ∈ heightP)
24
+ agreement : ∀ g h g' h' v v', ZFSet.pair g g' ∈ actors → ZFSet.pair h h' ∈ actors →
25
+ ZFSet.pair v v' ∈ points → ActionAgreementBelow P rP AP g h v →
26
+ ActionAgreementBelow Q rQ AQ g' h' v'
27
+
28
+ namespace BoundedFormula
29
+
30
+ def transitionOrderFormula {n} (P Q rP rQ points : Fin n) : BoundedFormula n :=
31
+ let lift (i : Fin n) := i.succ.succ.succ.succ
32
+ .allMem P (.allMem P.succ (.allMem Q.succ.succ (.allMem Q.succ.succ.succ
33
+ (imp (.conj (pairMembershipFormula 3 1 (lift points)) (pairMembershipFormula 2 0 (lift points)))
34
+ (.conj (imp (pairMembershipFormula 1 0 (lift rQ)) (pairMembershipFormula 3 2 (lift rP)))
35
+ (imp (pairMembershipFormula 3 2 (lift rP)) (pairMembershipFormula 1 0 (lift rQ))))))))
36
+
37
+ def transitionEquivarianceFormula {n} (P Q G H AP AQ points actors : Fin n) : BoundedFormula n :=
38
+ let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ
39
+ .allMem G (.allMem H.succ (.allMem P.succ.succ (.allMem P.succ.succ.succ
40
+ (.allMem Q.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ
41
+ (imp (.conj (pairMembershipFormula 5 4 (lift actors))
42
+ (.conj (pairMembershipFormula 3 1 (lift points))
43
+ (.conj (pairMembershipFormula 2 0 (lift points))
44
+ (tripleMembershipFormula 5 3 2 (lift AP)))))
45
+ (tripleMembershipFormula 4 1 0 (lift AQ))))))))
46
+
47
+ def transitionHeightFormula {n} (P Q heightP heightQ points : Fin n) : BoundedFormula n :=
48
+ .allMem P (.allMem Q.succ (imp (pairMembershipFormula 1 0 points.succ.succ)
49
+ (graphFiberEqualityFormula 0 1 heightQ.succ.succ heightP.succ.succ)))
50
+
51
+ def transitionAgreementFormula {n} (P Q rP rQ G H AP AQ points actors : Fin n) : BoundedFormula n :=
52
+ let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ
53
+ .allMem G (.allMem G.succ (.allMem H.succ.succ (.allMem H.succ.succ.succ
54
+ (.allMem P.succ.succ.succ.succ (.allMem Q.succ.succ.succ.succ.succ
55
+ (imp (.conj (pairMembershipFormula 5 3 (lift actors))
56
+ (.conj (pairMembershipFormula 4 2 (lift actors))
57
+ (.conj (pairMembershipFormula 1 0 (lift points))
58
+ (actionAgreementBelowFormula (lift P) (lift rP) (lift AP) 5 4 1))))
59
+ (actionAgreementBelowFormula (lift Q) (lift rQ) (lift AQ) 3 2 0)))))))
60
+
61
+ def mainTransitionLawsFormula {n}
62
+ (P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n) :
63
+ BoundedFormula n :=
64
+ .conj (meetEmbeddingFormula P Q rP rQ μP μQ points)
65
+ (.conj (transitionOrderFormula P Q rP rQ points)
66
+ (.conj (groupEmbeddingFormula G H mG mH oneG oneH actors)
67
+ (.conj (transitionEquivarianceFormula P Q G H AP AQ points actors)
68
+ (.conj (pairMembershipFormula bP bQ points)
69
+ (.conj (transitionHeightFormula P Q heightP heightQ points)
70
+ (transitionAgreementFormula P Q rP rQ G H AP AQ points actors))))))
71
+
72
+ theorem truth_mainTransitionLawsFormula {n}
73
+ (P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n)
74
+ (env : Fin n → ZFSet.{u}) :
75
+ Truth (mainTransitionLawsFormula P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ
76
+ heightP heightQ points actors) env ↔
77
+ MainTransitionLaws (env P) (env Q) (env rP) (env rQ) (env μP) (env μQ) (env G) (env H)
78
+ (env mG) (env mH) (env oneG) (env oneH) (env AP) (env AQ) (env bP) (env bQ)
79
+ (env heightP) (env heightQ) (env points) (env actors) := by
80
+ simp only [mainTransitionLawsFormula, transitionOrderFormula, transitionEquivarianceFormula,
81
+ transitionHeightFormula, transitionAgreementFormula, Truth, truth_meetEmbeddingFormula,
82
+ truth_groupEmbeddingFormula, truth_imp, truth_pairMembershipFormula,
83
+ truth_tripleMembershipFormula, truth_graphFiberEqualityFormula, truth_actionAgreementBelowFormula]
84
+ constructor
85
+ · rintro ⟨point, order, group, equivariant, bottom, height, agreement⟩
86
+ have pb {x y : ZFSet.{u}} (entry : ZFSet.pair x y ∈ env points) : x ∈ env P ∧ y ∈ env Q :=
87
+ ZFSet.pair_mem_prod.1 (point.injection.function.1 entry)
88
+ have ab {x y : ZFSet.{u}} (entry : ZFSet.pair x y ∈ env actors) : x ∈ env G ∧ y ∈ env H :=
89
+ ZFSet.pair_mem_prod.1 (group.injection.function.1 entry)
90
+ refine ⟨point, ?_, group, ?_, bottom, ?_, ?_⟩
91
+ · intro x y x' y' xx yy
92
+ have h := order x (pb xx).1 y (pb yy).1 x' (pb xx).2 y' (pb yy).2 ⟨xx, yy⟩
93
+ exact ⟨h.1, h.2⟩
94
+ · intro g g' x y x' y' gg xx yy act
95
+ exact equivariant g (ab gg).1 g' (ab gg).2 x (pb xx).1 y (pb yy).1
96
+ x' (pb xx).2 y' (pb yy).2 ⟨gg, xx, yy, act⟩
97
+ · intro x y z entry
98
+ exact height x (pb entry).1 y (pb entry).2 entry z
99
+ · intro g h g' h' v v' gg hh vv agree
100
+ exact agreement g (ab gg).1 h (ab hh).1 g' (ab gg).2 h' (ab hh).2
101
+ v (pb vv).1 v' (pb vv).2 ⟨gg, hh, vv, agree⟩
102
+ · intro code
103
+ refine ⟨code.point_embedding, ?_, code.group_embedding, ?_, code.bottom, ?_, ?_⟩
104
+ · intro x _ y _ x' _ y' _ h
105
+ exact ⟨(code.order_iff x y x' y' h.1 h.2).1, (code.order_iff x y x' y' h.1 h.2).2⟩
106
+ · intro g _ g' _ x _ y _ x' _ y' _ h
107
+ exact code.equivariant g g' x y x' y' h.1 h.2.1 h.2.2.1 h.2.2.2
108
+ · intro x _ y _ entry z
109
+ exact code.height x y z entry
110
+ · intro g _ h _ g' _ h' _ v _ v' _ entries
111
+ exact code.agreement g h g' h' v v' entries.1 entries.2.1 entries.2.2.1 entries.2.2.2
112
+
113
+ theorem realize_mainTransitionLawsFormula (M : TransitiveGround.{u}) {n}
114
+ (P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ heightP heightQ points actors : Fin n)
115
+ (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) :
116
+ Realize M.sets (mainTransitionLawsFormula P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ
117
+ heightP heightQ points actors).toFormula env ↔
118
+ MainTransitionLaws (env P) (env Q) (env rP) (env rQ) (env μP) (env μQ) (env G) (env H)
119
+ (env mG) (env mH) (env oneG) (env oneH) (env AP) (env AQ) (env bP) (env bQ)
120
+ (env heightP) (env heightQ) (env points) (env actors) :=
121
+ (realize_toFormula M _ env members).trans
122
+ (truth_mainTransitionLawsFormula P Q rP rQ μP μQ G H mG mH oneG oneH AP AQ bP bQ
123
+ heightP heightQ points actors env)
124
+
125
+ end BoundedFormula
126
+
127
+ end PartitionPilot.Forcing
128
+
129
+ end
130
+
131
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/MapFamilyApplicationGraphs.lean CHANGED
@@ -1,373 +1,373 @@
1
- import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs
2
-
3
- namespace OAI
4
-
5
-
6
- namespace PartitionPilot.Forcing
7
-
8
- section
9
-
10
- universe u
11
-
12
- noncomputable def indexedRelationSection (B C R i : ZFSet.{u}) : ZFSet.{u} :=
13
- ZFSet.sep (fun z => ∃ q ∈ B, ∃ y ∈ C,
14
- z = ZFSet.pair q y ∧ ZFSet.pair (ZFSet.pair i q) y ∈ R) (ZFSet.prod B C)
15
-
16
- theorem indexedRelationSection_subset (B C R i : ZFSet.{u}) :
17
- indexedRelationSection B C R i ⊆ ZFSet.prod B C :=
18
- fun _ hz => (ZFSet.mem_sep.1 hz).1
19
-
20
- theorem mem_indexedRelationSection (B C R i z : ZFSet.{u}) :
21
- z ∈ indexedRelationSection B C R i ↔ ∃ q ∈ B, ∃ y ∈ C,
22
- z = ZFSet.pair q y ∧ ZFSet.pair (ZFSet.pair i q) y ∈ R := by
23
- constructor
24
- · intro hz
25
- exact (ZFSet.mem_sep.1 hz).2
26
- · rintro ⟨q, hq, y, hy, rfl, entry⟩
27
- exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hq, hy⟩, q, hq, y, hy, rfl, entry⟩
28
-
29
- theorem pair_mem_indexedRelationSection (B C R i q y : ZFSet.{u}) :
30
- ZFSet.pair q y ∈ indexedRelationSection B C R i ↔
31
- q ∈ B ∧ y ∈ C ∧ ZFSet.pair (ZFSet.pair i q) y ∈ R := by
32
- rw [mem_indexedRelationSection]
33
- constructor
34
- · rintro ⟨q', hq, y', hy, equal, entry⟩
35
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
36
- exact ⟨hq, hy, entry⟩
37
- · rintro ⟨hq, hy, entry⟩
38
- exact ⟨q, hq, y, hy, rfl, entry⟩
39
-
40
-
41
-
42
-
43
-
44
-
45
- namespace BoundedFormula
46
-
47
- open SetFormula
48
-
49
- def indexedRelationSectionEntryFormula {n} (z i b c r : Fin n) : BoundedFormula n :=
50
- exMem b (exMem c.succ (.conj (orderedPairFormula z.succ.succ 1 0)
51
- (tripleMembershipFormula i.succ.succ 1 0 r.succ.succ)))
52
-
53
- theorem truth_indexedRelationSectionEntryFormula {n} (z i b c r : Fin n)
54
- (env : Fin n → ZFSet.{u}) :
55
- Truth (indexedRelationSectionEntryFormula z i b c r) env ↔
56
- env z ∈ indexedRelationSection (env b) (env c) (env r) (env i) := by
57
- simp only [indexedRelationSectionEntryFormula, truth_exMem, Truth,
58
- truth_orderedPairFormula, truth_tripleMembershipFormula, mem_indexedRelationSection]
59
- rfl
60
-
61
- def indexedRelationSectionFormula {n} (f i b c r : Fin n) : BoundedFormula n :=
62
- .conj (.allMem f (indexedRelationSectionEntryFormula 0 i.succ b.succ c.succ r.succ))
63
- (.allMem b (.allMem c.succ
64
- (imp (tripleMembershipFormula i.succ.succ 1 0 r.succ.succ)
65
- (pairMembershipFormula 1 0 f.succ.succ))))
66
-
67
- theorem truth_indexedRelationSectionFormula {n} (f i b c r : Fin n)
68
- (env : Fin n → ZFSet.{u}) :
69
- Truth (indexedRelationSectionFormula f i b c r) env ↔
70
- env f = indexedRelationSection (env b) (env c) (env r) (env i) := by
71
- simp only [indexedRelationSectionFormula, Truth, truth_indexedRelationSectionEntryFormula,
72
- truth_imp, truth_tripleMembershipFormula, truth_pairMembershipFormula]
73
- constructor
74
- · rintro ⟨subset, complete⟩
75
- apply ZFSet.ext
76
- intro z
77
- refine ⟨subset z, ?_⟩
78
- intro hz
79
- obtain ⟨q, hq, y, hy, rfl, entry⟩ := (mem_indexedRelationSection _ _ _ _ z).1 hz
80
- exact complete q hq y hy entry
81
- · intro equal
82
- refine ⟨fun _ hz => equal ▸ hz, ?_⟩
83
- intro q hq y hy entry
84
- change ZFSet.pair q y ∈ env f
85
- rw [equal]
86
- exact (pair_mem_indexedRelationSection _ _ _ _ q y).2 ⟨hq, hy, entry⟩
87
-
88
- def indexedRelationFamilyEntryFormula {n} (z domain bound b c r : Fin n) : BoundedFormula n :=
89
- exMem domain (exMem bound.succ (.conj (orderedPairFormula z.succ.succ 1 0)
90
- (indexedRelationSectionFormula 0 1 b.succ.succ c.succ.succ r.succ.succ)))
91
-
92
- theorem truth_indexedRelationFamilyEntryFormula {n} (z domain bound b c r : Fin n)
93
- (env : Fin n → ZFSet.{u}) :
94
- Truth (indexedRelationFamilyEntryFormula z domain bound b c r) env ↔
95
- ∃ i ∈ env domain, ∃ f ∈ env bound, env z = ZFSet.pair i f ∧
96
- f = indexedRelationSection (env b) (env c) (env r) i := by
97
- simp only [indexedRelationFamilyEntryFormula, truth_exMem, Truth,
98
- truth_orderedPairFormula, truth_indexedRelationSectionFormula]
99
- rfl
100
-
101
- end BoundedFormula
102
-
103
- namespace TransitiveGround
104
-
105
- open SetFormula
106
- variable (M : TransitiveGround.{u})
107
-
108
- theorem indexedRelationSection_mem
109
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
110
- (unions : Realize M.sets SetFormula.union Fin.elim0)
111
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
112
- {B C R i : ZFSet.{u}} (hB : B ∈ M.sets) (hC : C ∈ M.sets)
113
- (hR : R ∈ M.sets) (hi : i ∈ M.sets) : indexedRelationSection B C R i ∈ M.sets := by
114
- let params := extend i (extend B (extend C (extend R Fin.elim0)))
115
- have selected := M.bounded_separation_mem separation
116
- (BoundedFormula.indexedRelationSectionEntryFormula 0 1 2 3 4) params
117
- (Fin.cases hi (Fin.cases hB (Fin.cases hC (Fin.cases hR (fun j => Fin.elim0 j)))))
118
- (M.prod_mem pairing unions powers separation hB hC)
119
- have equal : ZFSet.sep (fun z => BoundedFormula.Truth
120
- (BoundedFormula.indexedRelationSectionEntryFormula 0 1 2 3 4) (extend z params))
121
- (ZFSet.prod B C) = indexedRelationSection B C R i := by
122
- apply ZFSet.ext
123
- intro z
124
- rw [ZFSet.mem_sep, BoundedFormula.truth_indexedRelationSectionEntryFormula]
125
- exact ⟨And.right, fun hz => ⟨indexedRelationSection_subset B C R i hz, hz⟩⟩
126
- exact equal ▸ selected
127
-
128
- noncomputable def indexedRelationSections (I B C R : ZFSet.{u}) : ZFSet.{u} :=
129
- ZFSet.sep (fun z => ∃ i ∈ I, ∃ f ∈ M.groundRelations B C,
130
- z = ZFSet.pair i f ∧ f = indexedRelationSection B C R i)
131
- (ZFSet.prod I (M.groundRelations B C))
132
-
133
- theorem pair_mem_indexedRelationSections (I B C R i f : ZFSet.{u}) :
134
- ZFSet.pair i f ∈ M.indexedRelationSections I B C R ↔
135
- i ∈ I ∧ f ∈ M.groundRelations B C ∧ f = indexedRelationSection B C R i := by
136
- rw [indexedRelationSections, ZFSet.mem_sep, ZFSet.pair_mem_prod]
137
- constructor
138
- · rintro ⟨⟨hi, hf⟩, j, _, g, _, equal, sectionEq⟩
139
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
140
- exact ⟨hi, hf, sectionEq⟩
141
- · rintro ⟨hi, hf, sectionEq⟩
142
- exact ⟨⟨hi, hf⟩, i, hi, f, hf, rfl, sectionEq⟩
143
-
144
- theorem indexedRelationSections_mem
145
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
146
- (unions : Realize M.sets SetFormula.union Fin.elim0)
147
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
148
- {I B C R : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets)
149
- (hC : C ∈ M.sets) (hR : R ∈ M.sets) : M.indexedRelationSections I B C R ∈ M.sets := by
150
- have bound := M.groundRelations_mem pairing unions powers separation hB hC
151
- let params := extend I (extend (M.groundRelations B C) (extend B (extend C (extend R Fin.elim0))))
152
- have selected := M.bounded_separation_mem separation
153
- (BoundedFormula.indexedRelationFamilyEntryFormula 0 1 2 3 4 5) params
154
- (Fin.cases hI (Fin.cases bound (Fin.cases hB (Fin.cases hC
155
- (Fin.cases hR (fun j => Fin.elim0 j))))))
156
- (M.prod_mem pairing unions powers separation hI bound)
157
- have equal : ZFSet.sep (fun z => BoundedFormula.Truth
158
- (BoundedFormula.indexedRelationFamilyEntryFormula 0 1 2 3 4 5) (extend z params))
159
- (ZFSet.prod I (M.groundRelations B C)) = M.indexedRelationSections I B C R := by
160
- apply ZFSet.ext
161
- intro z
162
- rw [ZFSet.mem_sep, indexedRelationSections, ZFSet.mem_sep]
163
- exact and_congr Iff.rfl (BoundedFormula.truth_indexedRelationFamilyEntryFormula 0 1 2 3 4 5 _)
164
- exact equal ▸ selected
165
-
166
- theorem indexedRelationSections_function
167
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
168
- (unions : Realize M.sets SetFormula.union Fin.elim0)
169
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
170
- {I B C R : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets)
171
- (hC : C ∈ M.sets) (hR : R ∈ M.sets) :
172
- ZFSet.IsFunc I (M.groundRelations B C) (M.indexedRelationSections I B C R) := by
173
- refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩
174
- intro i hi
175
- have sectionBound := (M.mem_groundRelations B C (indexedRelationSection B C R i)).2
176
- ⟨M.indexedRelationSection_mem pairing unions powers separation hB hC hR (M.transitive hI hi),
177
- indexedRelationSection_subset B C R i⟩
178
- exact ⟨indexedRelationSection B C R i,
179
- (M.pair_mem_indexedRelationSections I B C R i _).2 ⟨hi, sectionBound, rfl⟩,
180
- fun f hf => ((M.pair_mem_indexedRelationSections I B C R i f).1 hf).2.2⟩
181
-
182
- theorem indexedRelationSections_spec
183
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
184
- (unions : Realize M.sets SetFormula.union Fin.elim0)
185
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
186
- {I B C R : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets)
187
- (hC : C ∈ M.sets) (hR : R ∈ M.sets) :
188
- M.indexedRelationSections I B C R ∈ M.sets ∧
189
- ZFSet.IsFunc I (M.groundRelations B C) (M.indexedRelationSections I B C R) ∧
190
- ∀ i f, ZFSet.pair i f ∈ M.indexedRelationSections I B C R ↔
191
- i ∈ I ∧ f = indexedRelationSection B C R i := by
192
- have func := M.indexedRelationSections_function pairing unions powers separation hI hB hC hR
193
- refine ⟨M.indexedRelationSections_mem pairing unions powers separation hI hB hC hR, func, ?_⟩
194
- intro i f
195
- constructor
196
- · intro entry
197
- have parts := (M.pair_mem_indexedRelationSections I B C R i f).1 entry
198
- exact ⟨parts.1, parts.2.2⟩
199
- · rintro ⟨hi, rfl⟩
200
- obtain ⟨g, entry, _⟩ := func.2 i hi
201
- have equal := ((M.pair_mem_indexedRelationSections I B C R i g).1 entry).2.2
202
- exact equal ▸ entry
203
-
204
- end TransitiveGround
205
-
206
- end
207
-
208
-
209
-
210
- open SetFormula
211
- universe u
212
-
213
- noncomputable def indexedCarrierLabels (T U A : ZFSet.{u}) : ZFSet.{u} :=
214
- ZFSet.sep (fun z => ∃ i ∈ T, ∃ X ∈ ZFSet.sUnion (ZFSet.sUnion A), ∃ x ∈ X,
215
- z = ZFSet.pair i x ∧ ZFSet.pair i X ∈ A) (ZFSet.prod T U)
216
-
217
- theorem indexedCarrierLabels_subset (T U A : ZFSet.{u}) :
218
- indexedCarrierLabels T U A ⊆ ZFSet.prod T U :=
219
- fun _ hz => (ZFSet.mem_sep.1 hz).1
220
-
221
- theorem mem_indexedCarrierLabels (T U A z : ZFSet.{u}) :
222
- z ∈ indexedCarrierLabels T U A ↔
223
- ∃ i ∈ T, ∃ X ∈ ZFSet.sUnion (ZFSet.sUnion A), ∃ x ∈ X,
224
- x ∈ U ∧ z = ZFSet.pair i x ∧ ZFSet.pair i X ∈ A := by
225
- constructor
226
- · intro hz
227
- obtain ⟨bound, i, hi, X, hX, x, hx, rfl, entry⟩ := ZFSet.mem_sep.1 hz
228
- exact ⟨i, hi, X, hX, x, hx, (ZFSet.pair_mem_prod.1 bound).2, rfl, entry⟩
229
- · rintro ⟨i, hi, X, hX, x, hx, hu, rfl, entry⟩
230
- exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hu⟩, i, hi, X, hX, x, hx, rfl, entry⟩
231
-
232
- theorem pair_mem_indexedCarrierLabels (T U A i x : ZFSet.{u}) :
233
- ZFSet.pair i x ∈ indexedCarrierLabels T U A ↔
234
- i ∈ T ∧ x ∈ U ∧ ∃ X, ZFSet.pair i X ∈ A ∧ x ∈ X := by
235
- rw [mem_indexedCarrierLabels]
236
- constructor
237
- · rintro ⟨j, hj, X, _, y, hy, hu, equal, entry⟩
238
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
239
- exact ⟨hj, hu, X, entry, hy⟩
240
- · rintro ⟨hi, hu, X, entry, hx⟩
241
- exact ⟨i, hi, X, pair_second_mem_doubleUnion entry, x, hx, hu, rfl, entry⟩
242
-
243
- theorem pair_mem_indexedCarrierLabels_of_entry {T U A i X x : ZFSet.{u}}
244
- (family : FunctionGraphOn T A) (entry : ZFSet.pair i X ∈ A) (bound : X ⊆ U) :
245
- ZFSet.pair i x ∈ indexedCarrierLabels T U A ↔ x ∈ X := by
246
- rw [pair_mem_indexedCarrierLabels]
247
- constructor
248
- · rintro ⟨_, _, Y, other, hx⟩
249
- exact (family.unique other entry) ▸ hx
250
- · intro hx
251
- exact ⟨family.pair_source entry, bound hx, X, entry, hx⟩
252
-
253
- namespace BoundedFormula
254
-
255
- def indexedCarrierLabelFormula {n} (z T U A V : Fin n) : BoundedFormula n :=
256
- exMem T (exMem V.succ (exMem 0
257
- (.conj (.mem 0 U.succ.succ.succ)
258
- (.conj (orderedPairFormula z.succ.succ.succ 2 0)
259
- (pairMembershipFormula 2 1 A.succ.succ.succ)))))
260
-
261
- theorem truth_indexedCarrierLabelFormula {n} (z T U A V : Fin n)
262
- (env : Fin n → ZFSet.{u}) (bound : env V = ZFSet.sUnion (ZFSet.sUnion (env A))) :
263
- Truth (indexedCarrierLabelFormula z T U A V) env ↔
264
- env z ∈ indexedCarrierLabels (env T) (env U) (env A) := by
265
- simp only [indexedCarrierLabelFormula, truth_exMem, Truth,
266
- truth_orderedPairFormula, truth_pairMembershipFormula]
267
- change (∃ i ∈ env T, ∃ X ∈ env V, ∃ x ∈ X,
268
- x ∈ env U ∧ env z = ZFSet.pair i x ∧ ZFSet.pair i X ∈ env A) ↔ _
269
- rw [bound, mem_indexedCarrierLabels]
270
-
271
- end BoundedFormula
272
-
273
- namespace TransitiveGround
274
- variable (M : TransitiveGround.{u})
275
-
276
- theorem indexedCarrierLabels_mem
277
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
278
- (unions : Realize M.sets SetFormula.union Fin.elim0)
279
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
280
- {T U A : ZFSet.{u}} (hT : T ∈ M.sets) (hU : U ∈ M.sets) (hA : A ∈ M.sets) :
281
- indexedCarrierLabels T U A ∈ M.sets := by
282
- have hV := M.union_mem unions (M.union_mem unions hA)
283
- let params := extend T (extend U (extend A (extend (ZFSet.sUnion (ZFSet.sUnion A)) Fin.elim0)))
284
- have selected := M.bounded_separation_mem separation
285
- (BoundedFormula.indexedCarrierLabelFormula 0 1 2 3 4) params
286
- (Fin.cases hT (Fin.cases hU (Fin.cases hA (Fin.cases hV (fun j => Fin.elim0 j)))))
287
- (M.prod_mem pairing unions powers separation hT hU)
288
- have equal : ZFSet.sep (fun z => BoundedFormula.Truth
289
- (BoundedFormula.indexedCarrierLabelFormula 0 1 2 3 4) (extend z params))
290
- (ZFSet.prod T U) = indexedCarrierLabels T U A := by
291
- apply ZFSet.ext
292
- intro z
293
- rw [ZFSet.mem_sep, BoundedFormula.truth_indexedCarrierLabelFormula 0 1 2 3 4 _ rfl]
294
- exact ⟨And.right, fun hz => ⟨indexedCarrierLabels_subset T U A hz, hz⟩⟩
295
- exact equal ▸ selected
296
-
297
- end TransitiveGround
298
-
299
-
300
-
301
-
302
-
303
- noncomputable def mapFamilyApplicationGraph (I P Q family : ZFSet.{u}) : ZFSet.{u} :=
304
- ZFSet.sep (fun z => ∃ i ∈ I, ∃ x ∈ P, ∃ y ∈ Q, ∃ f ∈ ZFSet.sUnion (ZFSet.sUnion family),
305
- z = ZFSet.pair (ZFSet.pair i x) y ∧ ZFSet.pair i f ∈ family ∧ ZFSet.pair x y ∈ f)
306
- (ZFSet.prod (ZFSet.prod I P) Q)
307
-
308
- theorem pair_mem_mapFamilyApplicationGraph (I P Q family i x y : ZFSet.{u}) :
309
- ZFSet.pair (ZFSet.pair i x) y ∈ mapFamilyApplicationGraph I P Q family ↔
310
- i ∈ I ∧ x ∈ P ∧ y ∈ Q ∧ ∃ f, ZFSet.pair i f ∈ family ∧ ZFSet.pair x y ∈ f := by
311
- rw [mapFamilyApplicationGraph, ZFSet.mem_sep]
312
- constructor
313
- · rintro ⟨_, j, hj, a, ha, b, hb, f, _, equal, indexed, entry⟩
314
- obtain ⟨inner, rfl⟩ := ZFSet.pair_inj.1 equal
315
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner
316
- exact ⟨hj, ha, hb, f, indexed, entry⟩
317
- · rintro ⟨hi, hx, hy, f, indexed, entry⟩
318
- exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hx⟩, hy⟩,
319
- i, hi, x, hx, y, hy, f, pair_second_mem_doubleUnion indexed, rfl, indexed, entry⟩
320
-
321
- namespace BoundedFormula
322
-
323
- def mapFamilyApplicationEntryFormula {n} (z I P Q B family : Fin n) : BoundedFormula n :=
324
- exMem I (exMem P.succ (exMem Q.succ.succ (exMem B.succ.succ.succ
325
- (.conj (orderedTripleFormula z.succ.succ.succ.succ 3 2 1)
326
- (.conj (pairMembershipFormula 3 0 family.succ.succ.succ.succ)
327
- (pairMembershipFormula 2 1 0))))))
328
-
329
- theorem truth_mapFamilyApplicationEntryFormula {n} (z I P Q B family : Fin n)
330
- (env : Fin n → ZFSet.{u}) :
331
- Truth (mapFamilyApplicationEntryFormula z I P Q B family) env ↔
332
- ∃ i ∈ env I, ∃ x ∈ env P, ∃ y ∈ env Q, ∃ f ∈ env B,
333
- env z = ZFSet.pair (ZFSet.pair i x) y ∧
334
- ZFSet.pair i f ∈ env family ∧ ZFSet.pair x y ∈ f := by
335
- simp only [mapFamilyApplicationEntryFormula, truth_exMem, Truth,
336
- truth_orderedTripleFormula, truth_pairMembershipFormula]
337
- rfl
338
-
339
- end BoundedFormula
340
-
341
- namespace TransitiveGround
342
- variable (M : TransitiveGround.{u})
343
-
344
- theorem mapFamilyApplicationGraph_mem
345
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
346
- (unions : Realize M.sets SetFormula.union Fin.elim0)
347
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
348
- {I P Q family : ZFSet.{u}} (hI : I ∈ M.sets) (hP : P ∈ M.sets)
349
- (hQ : Q ∈ M.sets) (hFamily : family ∈ M.sets) :
350
- mapFamilyApplicationGraph I P Q family ∈ M.sets := by
351
- have hB := M.union_mem unions (M.union_mem unions hFamily)
352
- let params := extend I (extend P (extend Q (extend (ZFSet.sUnion (ZFSet.sUnion family)) (extend family Fin.elim0))))
353
- have selected := M.bounded_separation_mem separation
354
- (BoundedFormula.mapFamilyApplicationEntryFormula 0 1 2 3 4 5) params
355
- (Fin.cases hI (Fin.cases hP (Fin.cases hQ (Fin.cases hB (Fin.cases hFamily
356
- (fun i => Fin.elim0 i))))))
357
- (M.prod_mem pairing unions powers separation (M.prod_mem pairing unions powers separation hI hP) hQ)
358
- have equal : ZFSet.sep (fun z => BoundedFormula.Truth
359
- (BoundedFormula.mapFamilyApplicationEntryFormula 0 1 2 3 4 5) (extend z params))
360
- (ZFSet.prod (ZFSet.prod I P) Q) = mapFamilyApplicationGraph I P Q family := by
361
- apply ZFSet.ext
362
- intro z
363
- rw [ZFSet.mem_sep, mapFamilyApplicationGraph, ZFSet.mem_sep,
364
- BoundedFormula.truth_mapFamilyApplicationEntryFormula]
365
- rfl
366
- exact equal ▸ selected
367
-
368
- end TransitiveGround
369
-
370
-
371
- end PartitionPilot.Forcing
372
-
373
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Definability.GroundFlatCopyGraphs
2
+
3
+ namespace OAI
4
+
5
+
6
+ namespace PartitionPilot.Forcing
7
+
8
+ section
9
+
10
+ universe u
11
+
12
+ noncomputable def indexedRelationSection (B C R i : ZFSet.{u}) : ZFSet.{u} :=
13
+ ZFSet.sep (fun z => ∃ q ∈ B, ∃ y ∈ C,
14
+ z = ZFSet.pair q y ∧ ZFSet.pair (ZFSet.pair i q) y ∈ R) (ZFSet.prod B C)
15
+
16
+ theorem indexedRelationSection_subset (B C R i : ZFSet.{u}) :
17
+ indexedRelationSection B C R i ⊆ ZFSet.prod B C :=
18
+ fun _ hz => (ZFSet.mem_sep.1 hz).1
19
+
20
+ theorem mem_indexedRelationSection (B C R i z : ZFSet.{u}) :
21
+ z ∈ indexedRelationSection B C R i ↔ ∃ q ∈ B, ∃ y ∈ C,
22
+ z = ZFSet.pair q y ∧ ZFSet.pair (ZFSet.pair i q) y ∈ R := by
23
+ constructor
24
+ · intro hz
25
+ exact (ZFSet.mem_sep.1 hz).2
26
+ · rintro ⟨q, hq, y, hy, rfl, entry⟩
27
+ exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hq, hy⟩, q, hq, y, hy, rfl, entry⟩
28
+
29
+ theorem pair_mem_indexedRelationSection (B C R i q y : ZFSet.{u}) :
30
+ ZFSet.pair q y ∈ indexedRelationSection B C R i ↔
31
+ q ∈ B ∧ y ∈ C ∧ ZFSet.pair (ZFSet.pair i q) y ∈ R := by
32
+ rw [mem_indexedRelationSection]
33
+ constructor
34
+ · rintro ⟨q', hq, y', hy, equal, entry⟩
35
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
36
+ exact ⟨hq, hy, entry⟩
37
+ · rintro ⟨hq, hy, entry⟩
38
+ exact ⟨q, hq, y, hy, rfl, entry⟩
39
+
40
+
41
+
42
+
43
+
44
+
45
+ namespace BoundedFormula
46
+
47
+ open SetFormula
48
+
49
+ def indexedRelationSectionEntryFormula {n} (z i b c r : Fin n) : BoundedFormula n :=
50
+ exMem b (exMem c.succ (.conj (orderedPairFormula z.succ.succ 1 0)
51
+ (tripleMembershipFormula i.succ.succ 1 0 r.succ.succ)))
52
+
53
+ theorem truth_indexedRelationSectionEntryFormula {n} (z i b c r : Fin n)
54
+ (env : Fin n → ZFSet.{u}) :
55
+ Truth (indexedRelationSectionEntryFormula z i b c r) env ↔
56
+ env z ∈ indexedRelationSection (env b) (env c) (env r) (env i) := by
57
+ simp only [indexedRelationSectionEntryFormula, truth_exMem, Truth,
58
+ truth_orderedPairFormula, truth_tripleMembershipFormula, mem_indexedRelationSection]
59
+ rfl
60
+
61
+ def indexedRelationSectionFormula {n} (f i b c r : Fin n) : BoundedFormula n :=
62
+ .conj (.allMem f (indexedRelationSectionEntryFormula 0 i.succ b.succ c.succ r.succ))
63
+ (.allMem b (.allMem c.succ
64
+ (imp (tripleMembershipFormula i.succ.succ 1 0 r.succ.succ)
65
+ (pairMembershipFormula 1 0 f.succ.succ))))
66
+
67
+ theorem truth_indexedRelationSectionFormula {n} (f i b c r : Fin n)
68
+ (env : Fin n → ZFSet.{u}) :
69
+ Truth (indexedRelationSectionFormula f i b c r) env ↔
70
+ env f = indexedRelationSection (env b) (env c) (env r) (env i) := by
71
+ simp only [indexedRelationSectionFormula, Truth, truth_indexedRelationSectionEntryFormula,
72
+ truth_imp, truth_tripleMembershipFormula, truth_pairMembershipFormula]
73
+ constructor
74
+ · rintro ⟨subset, complete⟩
75
+ apply ZFSet.ext
76
+ intro z
77
+ refine ⟨subset z, ?_⟩
78
+ intro hz
79
+ obtain ⟨q, hq, y, hy, rfl, entry⟩ := (mem_indexedRelationSection _ _ _ _ z).1 hz
80
+ exact complete q hq y hy entry
81
+ · intro equal
82
+ refine ⟨fun _ hz => equal ▸ hz, ?_⟩
83
+ intro q hq y hy entry
84
+ change ZFSet.pair q y ∈ env f
85
+ rw [equal]
86
+ exact (pair_mem_indexedRelationSection _ _ _ _ q y).2 ⟨hq, hy, entry⟩
87
+
88
+ def indexedRelationFamilyEntryFormula {n} (z domain bound b c r : Fin n) : BoundedFormula n :=
89
+ exMem domain (exMem bound.succ (.conj (orderedPairFormula z.succ.succ 1 0)
90
+ (indexedRelationSectionFormula 0 1 b.succ.succ c.succ.succ r.succ.succ)))
91
+
92
+ theorem truth_indexedRelationFamilyEntryFormula {n} (z domain bound b c r : Fin n)
93
+ (env : Fin n → ZFSet.{u}) :
94
+ Truth (indexedRelationFamilyEntryFormula z domain bound b c r) env ↔
95
+ ∃ i ∈ env domain, ∃ f ∈ env bound, env z = ZFSet.pair i f ∧
96
+ f = indexedRelationSection (env b) (env c) (env r) i := by
97
+ simp only [indexedRelationFamilyEntryFormula, truth_exMem, Truth,
98
+ truth_orderedPairFormula, truth_indexedRelationSectionFormula]
99
+ rfl
100
+
101
+ end BoundedFormula
102
+
103
+ namespace TransitiveGround
104
+
105
+ open SetFormula
106
+ variable (M : TransitiveGround.{u})
107
+
108
+ theorem indexedRelationSection_mem
109
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
110
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
111
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
112
+ {B C R i : ZFSet.{u}} (hB : B ∈ M.sets) (hC : C ∈ M.sets)
113
+ (hR : R ∈ M.sets) (hi : i ∈ M.sets) : indexedRelationSection B C R i ∈ M.sets := by
114
+ let params := extend i (extend B (extend C (extend R Fin.elim0)))
115
+ have selected := M.bounded_separation_mem separation
116
+ (BoundedFormula.indexedRelationSectionEntryFormula 0 1 2 3 4) params
117
+ (Fin.cases hi (Fin.cases hB (Fin.cases hC (Fin.cases hR (fun j => Fin.elim0 j)))))
118
+ (M.prod_mem pairing unions powers separation hB hC)
119
+ have equal : ZFSet.sep (fun z => BoundedFormula.Truth
120
+ (BoundedFormula.indexedRelationSectionEntryFormula 0 1 2 3 4) (extend z params))
121
+ (ZFSet.prod B C) = indexedRelationSection B C R i := by
122
+ apply ZFSet.ext
123
+ intro z
124
+ rw [ZFSet.mem_sep, BoundedFormula.truth_indexedRelationSectionEntryFormula]
125
+ exact ⟨And.right, fun hz => ⟨indexedRelationSection_subset B C R i hz, hz⟩⟩
126
+ exact equal ▸ selected
127
+
128
+ noncomputable def indexedRelationSections (I B C R : ZFSet.{u}) : ZFSet.{u} :=
129
+ ZFSet.sep (fun z => ∃ i ∈ I, ∃ f ∈ M.groundRelations B C,
130
+ z = ZFSet.pair i f ∧ f = indexedRelationSection B C R i)
131
+ (ZFSet.prod I (M.groundRelations B C))
132
+
133
+ theorem pair_mem_indexedRelationSections (I B C R i f : ZFSet.{u}) :
134
+ ZFSet.pair i f ∈ M.indexedRelationSections I B C R ↔
135
+ i ∈ I ∧ f ∈ M.groundRelations B C ∧ f = indexedRelationSection B C R i := by
136
+ rw [indexedRelationSections, ZFSet.mem_sep, ZFSet.pair_mem_prod]
137
+ constructor
138
+ · rintro ⟨⟨hi, hf⟩, j, _, g, _, equal, sectionEq⟩
139
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
140
+ exact ⟨hi, hf, sectionEq⟩
141
+ · rintro ⟨hi, hf, sectionEq⟩
142
+ exact ⟨⟨hi, hf⟩, i, hi, f, hf, rfl, sectionEq⟩
143
+
144
+ theorem indexedRelationSections_mem
145
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
146
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
147
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
148
+ {I B C R : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets)
149
+ (hC : C ∈ M.sets) (hR : R ∈ M.sets) : M.indexedRelationSections I B C R ∈ M.sets := by
150
+ have bound := M.groundRelations_mem pairing unions powers separation hB hC
151
+ let params := extend I (extend (M.groundRelations B C) (extend B (extend C (extend R Fin.elim0))))
152
+ have selected := M.bounded_separation_mem separation
153
+ (BoundedFormula.indexedRelationFamilyEntryFormula 0 1 2 3 4 5) params
154
+ (Fin.cases hI (Fin.cases bound (Fin.cases hB (Fin.cases hC
155
+ (Fin.cases hR (fun j => Fin.elim0 j))))))
156
+ (M.prod_mem pairing unions powers separation hI bound)
157
+ have equal : ZFSet.sep (fun z => BoundedFormula.Truth
158
+ (BoundedFormula.indexedRelationFamilyEntryFormula 0 1 2 3 4 5) (extend z params))
159
+ (ZFSet.prod I (M.groundRelations B C)) = M.indexedRelationSections I B C R := by
160
+ apply ZFSet.ext
161
+ intro z
162
+ rw [ZFSet.mem_sep, indexedRelationSections, ZFSet.mem_sep]
163
+ exact and_congr Iff.rfl (BoundedFormula.truth_indexedRelationFamilyEntryFormula 0 1 2 3 4 5 _)
164
+ exact equal ▸ selected
165
+
166
+ theorem indexedRelationSections_function
167
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
168
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
169
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
170
+ {I B C R : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets)
171
+ (hC : C ∈ M.sets) (hR : R ∈ M.sets) :
172
+ ZFSet.IsFunc I (M.groundRelations B C) (M.indexedRelationSections I B C R) := by
173
+ refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩
174
+ intro i hi
175
+ have sectionBound := (M.mem_groundRelations B C (indexedRelationSection B C R i)).2
176
+ ⟨M.indexedRelationSection_mem pairing unions powers separation hB hC hR (M.transitive hI hi),
177
+ indexedRelationSection_subset B C R i⟩
178
+ exact ⟨indexedRelationSection B C R i,
179
+ (M.pair_mem_indexedRelationSections I B C R i _).2 ⟨hi, sectionBound, rfl⟩,
180
+ fun f hf => ((M.pair_mem_indexedRelationSections I B C R i f).1 hf).2.2⟩
181
+
182
+ theorem indexedRelationSections_spec
183
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
184
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
185
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
186
+ {I B C R : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets)
187
+ (hC : C ∈ M.sets) (hR : R ∈ M.sets) :
188
+ M.indexedRelationSections I B C R ∈ M.sets ∧
189
+ ZFSet.IsFunc I (M.groundRelations B C) (M.indexedRelationSections I B C R) ∧
190
+ ∀ i f, ZFSet.pair i f ∈ M.indexedRelationSections I B C R ↔
191
+ i ∈ I ∧ f = indexedRelationSection B C R i := by
192
+ have func := M.indexedRelationSections_function pairing unions powers separation hI hB hC hR
193
+ refine ⟨M.indexedRelationSections_mem pairing unions powers separation hI hB hC hR, func, ?_⟩
194
+ intro i f
195
+ constructor
196
+ · intro entry
197
+ have parts := (M.pair_mem_indexedRelationSections I B C R i f).1 entry
198
+ exact ⟨parts.1, parts.2.2⟩
199
+ · rintro ⟨hi, rfl⟩
200
+ obtain ⟨g, entry, _⟩ := func.2 i hi
201
+ have equal := ((M.pair_mem_indexedRelationSections I B C R i g).1 entry).2.2
202
+ exact equal ▸ entry
203
+
204
+ end TransitiveGround
205
+
206
+ end
207
+
208
+
209
+
210
+ open SetFormula
211
+ universe u
212
+
213
+ noncomputable def indexedCarrierLabels (T U A : ZFSet.{u}) : ZFSet.{u} :=
214
+ ZFSet.sep (fun z => ∃ i ∈ T, ∃ X ∈ ZFSet.sUnion (ZFSet.sUnion A), ∃ x ∈ X,
215
+ z = ZFSet.pair i x ∧ ZFSet.pair i X ∈ A) (ZFSet.prod T U)
216
+
217
+ theorem indexedCarrierLabels_subset (T U A : ZFSet.{u}) :
218
+ indexedCarrierLabels T U A ⊆ ZFSet.prod T U :=
219
+ fun _ hz => (ZFSet.mem_sep.1 hz).1
220
+
221
+ theorem mem_indexedCarrierLabels (T U A z : ZFSet.{u}) :
222
+ z ∈ indexedCarrierLabels T U A ↔
223
+ ∃ i ∈ T, ∃ X ∈ ZFSet.sUnion (ZFSet.sUnion A), ∃ x ∈ X,
224
+ x ∈ U ∧ z = ZFSet.pair i x ∧ ZFSet.pair i X ∈ A := by
225
+ constructor
226
+ · intro hz
227
+ obtain ⟨bound, i, hi, X, hX, x, hx, rfl, entry⟩ := ZFSet.mem_sep.1 hz
228
+ exact ⟨i, hi, X, hX, x, hx, (ZFSet.pair_mem_prod.1 bound).2, rfl, entry⟩
229
+ · rintro ⟨i, hi, X, hX, x, hx, hu, rfl, entry⟩
230
+ exact ZFSet.mem_sep.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hu⟩, i, hi, X, hX, x, hx, rfl, entry⟩
231
+
232
+ theorem pair_mem_indexedCarrierLabels (T U A i x : ZFSet.{u}) :
233
+ ZFSet.pair i x ∈ indexedCarrierLabels T U A ↔
234
+ i ∈ T ∧ x ∈ U ∧ ∃ X, ZFSet.pair i X ∈ A ∧ x ∈ X := by
235
+ rw [mem_indexedCarrierLabels]
236
+ constructor
237
+ · rintro ⟨j, hj, X, _, y, hy, hu, equal, entry⟩
238
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
239
+ exact ⟨hj, hu, X, entry, hy⟩
240
+ · rintro ⟨hi, hu, X, entry, hx⟩
241
+ exact ⟨i, hi, X, pair_second_mem_doubleUnion entry, x, hx, hu, rfl, entry⟩
242
+
243
+ theorem pair_mem_indexedCarrierLabels_of_entry {T U A i X x : ZFSet.{u}}
244
+ (family : FunctionGraphOn T A) (entry : ZFSet.pair i X ∈ A) (bound : X ⊆ U) :
245
+ ZFSet.pair i x ∈ indexedCarrierLabels T U A ↔ x ∈ X := by
246
+ rw [pair_mem_indexedCarrierLabels]
247
+ constructor
248
+ · rintro ⟨_, _, Y, other, hx⟩
249
+ exact (family.unique other entry) ▸ hx
250
+ · intro hx
251
+ exact ⟨family.pair_source entry, bound hx, X, entry, hx⟩
252
+
253
+ namespace BoundedFormula
254
+
255
+ def indexedCarrierLabelFormula {n} (z T U A V : Fin n) : BoundedFormula n :=
256
+ exMem T (exMem V.succ (exMem 0
257
+ (.conj (.mem 0 U.succ.succ.succ)
258
+ (.conj (orderedPairFormula z.succ.succ.succ 2 0)
259
+ (pairMembershipFormula 2 1 A.succ.succ.succ)))))
260
+
261
+ theorem truth_indexedCarrierLabelFormula {n} (z T U A V : Fin n)
262
+ (env : Fin n → ZFSet.{u}) (bound : env V = ZFSet.sUnion (ZFSet.sUnion (env A))) :
263
+ Truth (indexedCarrierLabelFormula z T U A V) env ↔
264
+ env z ∈ indexedCarrierLabels (env T) (env U) (env A) := by
265
+ simp only [indexedCarrierLabelFormula, truth_exMem, Truth,
266
+ truth_orderedPairFormula, truth_pairMembershipFormula]
267
+ change (∃ i ∈ env T, ∃ X ∈ env V, ∃ x ∈ X,
268
+ x ∈ env U ∧ env z = ZFSet.pair i x ∧ ZFSet.pair i X ∈ env A) ↔ _
269
+ rw [bound, mem_indexedCarrierLabels]
270
+
271
+ end BoundedFormula
272
+
273
+ namespace TransitiveGround
274
+ variable (M : TransitiveGround.{u})
275
+
276
+ theorem indexedCarrierLabels_mem
277
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
278
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
279
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
280
+ {T U A : ZFSet.{u}} (hT : T ∈ M.sets) (hU : U ∈ M.sets) (hA : A ∈ M.sets) :
281
+ indexedCarrierLabels T U A ∈ M.sets := by
282
+ have hV := M.union_mem unions (M.union_mem unions hA)
283
+ let params := extend T (extend U (extend A (extend (ZFSet.sUnion (ZFSet.sUnion A)) Fin.elim0)))
284
+ have selected := M.bounded_separation_mem separation
285
+ (BoundedFormula.indexedCarrierLabelFormula 0 1 2 3 4) params
286
+ (Fin.cases hT (Fin.cases hU (Fin.cases hA (Fin.cases hV (fun j => Fin.elim0 j)))))
287
+ (M.prod_mem pairing unions powers separation hT hU)
288
+ have equal : ZFSet.sep (fun z => BoundedFormula.Truth
289
+ (BoundedFormula.indexedCarrierLabelFormula 0 1 2 3 4) (extend z params))
290
+ (ZFSet.prod T U) = indexedCarrierLabels T U A := by
291
+ apply ZFSet.ext
292
+ intro z
293
+ rw [ZFSet.mem_sep, BoundedFormula.truth_indexedCarrierLabelFormula 0 1 2 3 4 _ rfl]
294
+ exact ⟨And.right, fun hz => ⟨indexedCarrierLabels_subset T U A hz, hz⟩⟩
295
+ exact equal ▸ selected
296
+
297
+ end TransitiveGround
298
+
299
+
300
+
301
+
302
+
303
+ noncomputable def mapFamilyApplicationGraph (I P Q family : ZFSet.{u}) : ZFSet.{u} :=
304
+ ZFSet.sep (fun z => ∃ i ∈ I, ∃ x ∈ P, ∃ y ∈ Q, ∃ f ∈ ZFSet.sUnion (ZFSet.sUnion family),
305
+ z = ZFSet.pair (ZFSet.pair i x) y ∧ ZFSet.pair i f ∈ family ∧ ZFSet.pair x y ∈ f)
306
+ (ZFSet.prod (ZFSet.prod I P) Q)
307
+
308
+ theorem pair_mem_mapFamilyApplicationGraph (I P Q family i x y : ZFSet.{u}) :
309
+ ZFSet.pair (ZFSet.pair i x) y ∈ mapFamilyApplicationGraph I P Q family ↔
310
+ i ∈ I ∧ x ∈ P ∧ y ∈ Q ∧ ∃ f, ZFSet.pair i f ∈ family ∧ ZFSet.pair x y ∈ f := by
311
+ rw [mapFamilyApplicationGraph, ZFSet.mem_sep]
312
+ constructor
313
+ · rintro ⟨_, j, hj, a, ha, b, hb, f, _, equal, indexed, entry⟩
314
+ obtain ⟨inner, rfl⟩ := ZFSet.pair_inj.1 equal
315
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 inner
316
+ exact ⟨hj, ha, hb, f, indexed, entry⟩
317
+ · rintro ⟨hi, hx, hy, f, indexed, entry⟩
318
+ exact ⟨ZFSet.pair_mem_prod.2 ⟨ZFSet.pair_mem_prod.2 ⟨hi, hx⟩, hy⟩,
319
+ i, hi, x, hx, y, hy, f, pair_second_mem_doubleUnion indexed, rfl, indexed, entry⟩
320
+
321
+ namespace BoundedFormula
322
+
323
+ def mapFamilyApplicationEntryFormula {n} (z I P Q B family : Fin n) : BoundedFormula n :=
324
+ exMem I (exMem P.succ (exMem Q.succ.succ (exMem B.succ.succ.succ
325
+ (.conj (orderedTripleFormula z.succ.succ.succ.succ 3 2 1)
326
+ (.conj (pairMembershipFormula 3 0 family.succ.succ.succ.succ)
327
+ (pairMembershipFormula 2 1 0))))))
328
+
329
+ theorem truth_mapFamilyApplicationEntryFormula {n} (z I P Q B family : Fin n)
330
+ (env : Fin n → ZFSet.{u}) :
331
+ Truth (mapFamilyApplicationEntryFormula z I P Q B family) env ↔
332
+ ∃ i ∈ env I, ∃ x ∈ env P, ∃ y ∈ env Q, ∃ f ∈ env B,
333
+ env z = ZFSet.pair (ZFSet.pair i x) y ∧
334
+ ZFSet.pair i f ∈ env family ∧ ZFSet.pair x y ∈ f := by
335
+ simp only [mapFamilyApplicationEntryFormula, truth_exMem, Truth,
336
+ truth_orderedTripleFormula, truth_pairMembershipFormula]
337
+ rfl
338
+
339
+ end BoundedFormula
340
+
341
+ namespace TransitiveGround
342
+ variable (M : TransitiveGround.{u})
343
+
344
+ theorem mapFamilyApplicationGraph_mem
345
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
346
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
347
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
348
+ {I P Q family : ZFSet.{u}} (hI : I ∈ M.sets) (hP : P ∈ M.sets)
349
+ (hQ : Q ∈ M.sets) (hFamily : family ∈ M.sets) :
350
+ mapFamilyApplicationGraph I P Q family ∈ M.sets := by
351
+ have hB := M.union_mem unions (M.union_mem unions hFamily)
352
+ let params := extend I (extend P (extend Q (extend (ZFSet.sUnion (ZFSet.sUnion family)) (extend family Fin.elim0))))
353
+ have selected := M.bounded_separation_mem separation
354
+ (BoundedFormula.mapFamilyApplicationEntryFormula 0 1 2 3 4 5) params
355
+ (Fin.cases hI (Fin.cases hP (Fin.cases hQ (Fin.cases hB (Fin.cases hFamily
356
+ (fun i => Fin.elim0 i))))))
357
+ (M.prod_mem pairing unions powers separation (M.prod_mem pairing unions powers separation hI hP) hQ)
358
+ have equal : ZFSet.sep (fun z => BoundedFormula.Truth
359
+ (BoundedFormula.mapFamilyApplicationEntryFormula 0 1 2 3 4 5) (extend z params))
360
+ (ZFSet.prod (ZFSet.prod I P) Q) = mapFamilyApplicationGraph I P Q family := by
361
+ apply ZFSet.ext
362
+ intro z
363
+ rw [ZFSet.mem_sep, mapFamilyApplicationGraph, ZFSet.mem_sep,
364
+ BoundedFormula.truth_mapFamilyApplicationEntryFormula]
365
+ rfl
366
+ exact equal ▸ selected
367
+
368
+ end TransitiveGround
369
+
370
+
371
+ end PartitionPilot.Forcing
372
+
373
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/NameSupportFormulas.lean CHANGED
@@ -1,74 +1,74 @@
1
- import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProductActions
2
-
3
- namespace OAI
4
-
5
-
6
- namespace PartitionPilot.Forcing
7
-
8
- open SetRealization Compression.RecursiveMaps
9
- universe u
10
- variable {I G : Type u} [Group G]
11
-
12
- noncomputable def supportBasisCode (b : Presentation I) (t : Presentation G)
13
- (K : I → Subgroup G) : ZFSet.{u} := (b.product t).subset (fun z => z.2 ∈ K z.1)
14
-
15
- theorem pair_mem_supportBasisCode (b : Presentation I) (t : Presentation G)
16
- (K : I → Subgroup G) (i : I) (g : G) :
17
- ZFSet.pair (b.encode i) (t.encode g) ∈ supportBasisCode b t K ↔ g ∈ K i :=
18
- (b.product t).encode_mem_subset (fun z => z.2 ∈ K z.1) (i, g)
19
-
20
- theorem finalSupportFamily_basis (Label : Type 1) (H : Subgroup (MainStage.OrdinalRun.FinalActor Label)) :
21
- (MainStage.OrdinalRun.supportFamily Label).mem H ↔
22
- ∃ C, (MainStage.OrdinalRun.finalAction Label).fixSubgroup C ≤ H := Iff.rfl
23
-
24
- end PartitionPilot.Forcing
25
-
26
-
27
-
28
- namespace PartitionPilot.Forcing.SetFormula
29
-
30
- def nameSupportFormula : SetFormula 6 :=
31
- allConditions 3 (imp (pairMembershipFormula 2 0 5)
32
- (atomicApplication nameActionFormula (extend 3 (extend 6 Fin.elim0)) 0 1 1))
33
-
34
- end PartitionPilot.Forcing.SetFormula
35
-
36
- namespace PartitionPilot.Forcing.TransitiveGround
37
- open SetRealization SetFormula
38
- universe u
39
- variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P]
40
- variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I)
41
-
42
- theorem realize_nameSupportFormula (K : I → Subgroup G)
43
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
44
- (unions : Realize M.sets SetFormula.union Fin.elim0)
45
- (powers : Realize M.sets powerSet Fin.elim0)
46
- (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets)
47
- (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets)
48
- (supports : supportBasisCode b t K ∈ M.sets)
49
- (maps : a.conditionMapFamily s t ∈ M.sets)
50
- (i : I) (hi : b.encode i ∈ M.sets) (τ : Name s) (hτ : τ.val ∈ M.sets) :
51
- Realize M.sets nameSupportFormula
52
- (extend τ.val (extend (b.encode i) (extend s.carrier (extend t.carrier
53
- (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0)))))) ↔
54
- K i ≤ a.stabilizer s τ := by
55
- let env := extend τ.val (extend (b.encode i) (extend s.carrier (extend t.carrier
56
- (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0)))))
57
- rw [nameSupportFormula, M.realize_allConditions t 3 _ env group rfl]
58
- change (∀ g, Realize M.sets _ _) ↔ ∀ g, g ∈ K i → a.act s g τ = τ
59
- apply forall_congr'
60
- intro g
61
- let e := extend (t.encode g) env
62
- rw [realize_imp, M.realize_pairMembershipFormula pairing 2 0 5 e hi
63
- (M.transitive group (t.encode_mem g)) supports]
64
- change (ZFSet.pair (b.encode i) (t.encode g) ∈ supportBasisCode b t K → Realize M.sets _ e) ↔ _
65
- rw [pair_mem_supportBasisCode]
66
- apply forall_congr'
67
- intro _
68
- rw [realize_atomicApplication, map_extend, map_extend, map_empty]
69
- exact M.realize_nameActionFormula a s t pairing unions powers separation collection
70
- carrier group maps g τ τ hτ hτ
71
-
72
- end PartitionPilot.Forcing.TransitiveGround
73
-
74
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProductActions
2
+
3
+ namespace OAI
4
+
5
+
6
+ namespace PartitionPilot.Forcing
7
+
8
+ open SetRealization Compression.RecursiveMaps
9
+ universe u
10
+ variable {I G : Type u} [Group G]
11
+
12
+ noncomputable def supportBasisCode (b : Presentation I) (t : Presentation G)
13
+ (K : I → Subgroup G) : ZFSet.{u} := (b.product t).subset (fun z => z.2 ∈ K z.1)
14
+
15
+ theorem pair_mem_supportBasisCode (b : Presentation I) (t : Presentation G)
16
+ (K : I → Subgroup G) (i : I) (g : G) :
17
+ ZFSet.pair (b.encode i) (t.encode g) ∈ supportBasisCode b t K ↔ g ∈ K i :=
18
+ (b.product t).encode_mem_subset (fun z => z.2 ∈ K z.1) (i, g)
19
+
20
+ theorem finalSupportFamily_basis (Label : Type 1) (H : Subgroup (MainStage.OrdinalRun.FinalActor Label)) :
21
+ (MainStage.OrdinalRun.supportFamily Label).mem H ↔
22
+ ∃ C, (MainStage.OrdinalRun.finalAction Label).fixSubgroup C ≤ H := Iff.rfl
23
+
24
+ end PartitionPilot.Forcing
25
+
26
+
27
+
28
+ namespace PartitionPilot.Forcing.SetFormula
29
+
30
+ def nameSupportFormula : SetFormula 6 :=
31
+ allConditions 3 (imp (pairMembershipFormula 2 0 5)
32
+ (atomicApplication nameActionFormula (extend 3 (extend 6 Fin.elim0)) 0 1 1))
33
+
34
+ end PartitionPilot.Forcing.SetFormula
35
+
36
+ namespace PartitionPilot.Forcing.TransitiveGround
37
+ open SetRealization SetFormula
38
+ universe u
39
+ variable (M : TransitiveGround.{u}) {I G P : Type u} [Group G] [PartialOrder P]
40
+ variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G) (b : Presentation I)
41
+
42
+ theorem realize_nameSupportFormula (K : I → Subgroup G)
43
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
44
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
45
+ (powers : Realize M.sets powerSet Fin.elim0)
46
+ (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets)
47
+ (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets)
48
+ (supports : supportBasisCode b t K ∈ M.sets)
49
+ (maps : a.conditionMapFamily s t ∈ M.sets)
50
+ (i : I) (hi : b.encode i ∈ M.sets) (τ : Name s) (hτ : τ.val ∈ M.sets) :
51
+ Realize M.sets nameSupportFormula
52
+ (extend τ.val (extend (b.encode i) (extend s.carrier (extend t.carrier
53
+ (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0)))))) ↔
54
+ K i ≤ a.stabilizer s τ := by
55
+ let env := extend τ.val (extend (b.encode i) (extend s.carrier (extend t.carrier
56
+ (extend (supportBasisCode b t K) (extend (a.conditionMapFamily s t) Fin.elim0)))))
57
+ rw [nameSupportFormula, M.realize_allConditions t 3 _ env group rfl]
58
+ change (∀ g, Realize M.sets _ _) ↔ ∀ g, g ∈ K i → a.act s g τ = τ
59
+ apply forall_congr'
60
+ intro g
61
+ let e := extend (t.encode g) env
62
+ rw [realize_imp, M.realize_pairMembershipFormula pairing 2 0 5 e hi
63
+ (M.transitive group (t.encode_mem g)) supports]
64
+ change (ZFSet.pair (b.encode i) (t.encode g) ∈ supportBasisCode b t K → Realize M.sets _ e) ↔ _
65
+ rw [pair_mem_supportBasisCode]
66
+ apply forall_congr'
67
+ intro _
68
+ rw [realize_atomicApplication, map_extend, map_extend, map_empty]
69
+ exact M.realize_nameActionFormula a s t pairing unions powers separation collection
70
+ carrier group maps g τ τ hτ hτ
71
+
72
+ end PartitionPilot.Forcing.TransitiveGround
73
+
74
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/NatUnionCodes.lean CHANGED
@@ -1,373 +1,373 @@
1
- import OAI.SetTheory.PartitionPrinciple.Transfinite.SetRankBounds
2
-
3
- namespace OAI
4
-
5
-
6
- namespace PartitionPilot.SetRealization.Presentation
7
-
8
- universe u
9
- variable {A B : Type u} (s : Presentation A) (t : Presentation B) (f : A → B)
10
-
11
- noncomputable def graph : ZFSet.{u} :=
12
- (s.product t).subset (fun a => f a.1 = a.2)
13
-
14
- theorem pair_mem_graph (a : A) (b : B) :
15
- ZFSet.pair (s.encode a) (t.encode b) ∈ s.graph t f ↔ f a = b :=
16
- (s.product t).encode_mem_subset (fun a => f a.1 = a.2) (a, b)
17
-
18
- theorem mem_graph (x : ZFSet.{u}) :
19
- x ∈ s.graph t f ↔ ∃ a, ZFSet.pair (s.encode a) (t.encode (f a)) = x := by
20
- rw [graph, mem_subset]
21
- constructor
22
- · rintro ⟨⟨a, b⟩, h, eq⟩
23
- change f a = b at h
24
- subst b
25
- exact ⟨a, eq⟩
26
- · rintro ⟨a, eq⟩
27
- exact ⟨(a, f a), rfl, eq⟩
28
-
29
- theorem graph_isFunc : ZFSet.IsFunc s.carrier t.carrier (s.graph t f) := by
30
- refine ⟨(s.product t).subset_carrier _, ?_⟩
31
- intro x hx
32
- rcases (s.mem_carrier x).1 hx with ⟨a, rfl⟩
33
- refine ⟨t.encode (f a), (s.pair_mem_graph t f a (f a)).2 rfl, ?_⟩
34
- intro y hy
35
- rcases (s.mem_graph t f _).1 hy with ⟨b, eq⟩
36
- have parts := ZFSet.pair_inj.1 eq
37
- have ba := s.injective parts.1
38
- simpa only [ba] using parts.2.symm
39
-
40
- theorem graph_mem_funs : s.graph t f ∈ ZFSet.funs s.carrier t.carrier :=
41
- ZFSet.mem_funs.2 (s.graph_isFunc t f)
42
-
43
- theorem graph_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o)
44
- (hs : ZFSet.rank s.carrier < o) (ht : ZFSet.rank t.carrier < o) :
45
- ZFSet.rank (s.graph t f) < o :=
46
- (s.product t).subset_rank_lt (s.product_rank_lt limit t hs ht) _
47
-
48
- end PartitionPilot.SetRealization.Presentation
49
-
50
-
51
-
52
- namespace PartitionPilot.Forcing
53
-
54
- open scoped ZFSet
55
-
56
- universe u
57
-
58
- def FunctionGraphOn (A f : ZFSet.{u}) : Prop :=
59
- ∃ B, ZFSet.IsFunc A B f
60
-
61
- def graphRestriction (A f : ZFSet.{u}) : ZFSet.{u} :=
62
- ZFSet.sep (fun z => z ∈ ZFSet.prod A (⋃₀ ⋃₀ f)) f
63
-
64
- theorem pair_first_mem_doubleUnion {x y f : ZFSet.{u}}
65
- (entry : ZFSet.pair x y ∈ f) : x ∈ ⋃₀ ⋃₀ f := by
66
- exact ZFSet.mem_sUnion.2 ⟨{x}, ZFSet.mem_sUnion.2
67
- ⟨ZFSet.pair x y, entry, ZFSet.mem_pair.2 (Or.inl rfl)⟩,
68
- ZFSet.mem_singleton.2 rfl⟩
69
-
70
- theorem pair_second_mem_doubleUnion {x y f : ZFSet.{u}}
71
- (entry : ZFSet.pair x y ∈ f) : y ∈ ⋃₀ ⋃₀ f := by
72
- exact ZFSet.mem_sUnion.2 ⟨{x, y}, ZFSet.mem_sUnion.2
73
- ⟨ZFSet.pair x y, entry, ZFSet.mem_pair.2 (Or.inr rfl)⟩,
74
- ZFSet.mem_pair.2 (Or.inr rfl)⟩
75
-
76
- theorem pair_mem_graphRestriction {A f x y : ZFSet.{u}} :
77
- ZFSet.pair x y ∈ graphRestriction A f ↔ ZFSet.pair x y ∈ f ∧ x ∈ A := by
78
- constructor
79
- · intro h
80
- exact ⟨(ZFSet.mem_sep.1 h).1, (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 h).2).1⟩
81
- · rintro ⟨entry, hx⟩
82
- exact ZFSet.mem_sep.2 ⟨entry, ZFSet.pair_mem_prod.2
83
- ⟨hx, pair_second_mem_doubleUnion entry⟩⟩
84
-
85
- theorem mem_graphRestriction {A f z : ZFSet.{u}} :
86
- z ∈ graphRestriction A f ↔ ∃ x ∈ A, ∃ y, z = ZFSet.pair x y ∧ ZFSet.pair x y ∈ f := by
87
- constructor
88
- · intro h
89
- obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 h).2
90
- exact ⟨x, hx, y, rfl, (ZFSet.mem_sep.1 h).1⟩
91
- · rintro ⟨x, hx, y, rfl, entry⟩
92
- exact pair_mem_graphRestriction.2 ⟨entry, hx⟩
93
-
94
- theorem graphRestriction_subset (A f : ZFSet.{u}) : graphRestriction A f ⊆ f :=
95
- fun _ h => (ZFSet.mem_sep.1 h).1
96
-
97
- theorem graphRestriction_restrict {A B f : ZFSet.{u}} (subset : B ⊆ A) :
98
- graphRestriction B (graphRestriction A f) = graphRestriction B f := by
99
- apply ZFSet.ext
100
- intro z
101
- constructor
102
- · intro hz
103
- obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz
104
- exact pair_mem_graphRestriction.2 ⟨(pair_mem_graphRestriction.1 entry).1, hx⟩
105
- · intro hz
106
- obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz
107
- exact pair_mem_graphRestriction.2
108
- ⟨pair_mem_graphRestriction.2 ⟨entry, subset hx⟩, hx⟩
109
-
110
- theorem graphRestriction_eq_sep {A B C f : ZFSet.{u}} (h : ZFSet.IsFunc A B f) :
111
- graphRestriction C f = ZFSet.sep (fun z => z ∈ ZFSet.prod C B) f := by
112
- apply ZFSet.ext
113
- intro z
114
- constructor
115
- · intro hz
116
- obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz
117
- exact ZFSet.mem_sep.2 ⟨entry, ZFSet.pair_mem_prod.2
118
- ⟨hx, (ZFSet.pair_mem_prod.1 (h.1 entry)).2⟩⟩
119
- · intro hz
120
- obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).2
121
- exact pair_mem_graphRestriction.2 ⟨(ZFSet.mem_sep.1 hz).1, hx⟩
122
-
123
- theorem graphRestriction_insert_of_not_mem {A f x y : ZFSet.{u}} (fresh : x ∉ A) :
124
- graphRestriction A (insert (ZFSet.pair x y) f) = graphRestriction A f := by
125
- apply ZFSet.ext
126
- intro z
127
- constructor
128
- · intro hz
129
- obtain ⟨a, ha, b, rfl, entry⟩ := mem_graphRestriction.1 hz
130
- rcases ZFSet.mem_insert_iff.1 entry with eq | entry
131
- · exact False.elim (fresh ((ZFSet.pair_inj.1 eq).1 ▸ ha))
132
- · exact pair_mem_graphRestriction.2 ⟨entry, ha⟩
133
- · intro hz
134
- obtain ⟨a, ha, b, rfl, entry⟩ := mem_graphRestriction.1 hz
135
- exact pair_mem_graphRestriction.2 ⟨ZFSet.mem_insert_iff.2 (Or.inr entry), ha⟩
136
-
137
- namespace FunctionGraphOn
138
-
139
- theorem to_isFunc {A f : ZFSet.{u}} (h : FunctionGraphOn A f) :
140
- ZFSet.IsFunc A (⋃₀ ⋃₀ f) f := by
141
- obtain ⟨B, shape, total⟩ := h
142
- refine ⟨?_, total⟩
143
- intro z hz
144
- obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (shape hz)
145
- exact ZFSet.pair_mem_prod.2 ⟨hx, pair_second_mem_doubleUnion hz⟩
146
-
147
- theorem shape {A f : ZFSet.{u}} (h : FunctionGraphOn A f) :
148
- ∀ z ∈ f, ∃ x ∈ A, ∃ y, z = ZFSet.pair x y := by
149
- intro z hz
150
- obtain ⟨x, hx, y, _, eq⟩ := ZFSet.mem_prod.1 (h.to_isFunc.1 hz)
151
- exact ⟨x, hx, y, eq⟩
152
-
153
- theorem total {A f x : ZFSet.{u}} (h : FunctionGraphOn A f) (hx : x ∈ A) :
154
- ∃ y, ZFSet.pair x y ∈ f := by
155
- obtain ⟨y, entry, _⟩ := h.to_isFunc.2 x hx
156
- exact ⟨y, entry⟩
157
-
158
- theorem pair_source {A f x y : ZFSet.{u}} (h : FunctionGraphOn A f)
159
- (entry : ZFSet.pair x y ∈ f) : x ∈ A :=
160
- (ZFSet.pair_mem_prod.1 (h.to_isFunc.1 entry)).1
161
-
162
- theorem unique {A f x y z : ZFSet.{u}} (h : FunctionGraphOn A f)
163
- (hy : ZFSet.pair x y ∈ f) (hz : ZFSet.pair x z ∈ f) : y = z := by
164
- obtain ⟨w, _, unique⟩ := h.to_isFunc.2 x (h.pair_source hy)
165
- exact (unique y hy).trans (unique z hz).symm
166
-
167
- theorem restrict {A B f : ZFSet.{u}} (h : FunctionGraphOn A f) (subset : B ⊆ A) :
168
- FunctionGraphOn B (graphRestriction B f) := by
169
- refine ⟨⋃₀ ⋃₀ f, ?_, ?_⟩
170
- · intro z hz
171
- exact (ZFSet.mem_sep.1 hz).2
172
- · intro x hx
173
- obtain ⟨y, entry⟩ := h.total (subset hx)
174
- refine ⟨y, pair_mem_graphRestriction.2 ⟨entry, hx⟩, ?_⟩
175
- intro z hz
176
- exact h.unique (pair_mem_graphRestriction.1 hz).1 entry
177
-
178
- theorem restriction_eq {A f : ZFSet.{u}} (h : FunctionGraphOn A f) :
179
- graphRestriction A f = f := by
180
- apply ZFSet.ext
181
- intro z
182
- constructor
183
- · exact fun hz => graphRestriction_subset A f hz
184
- · intro hz
185
- exact ZFSet.mem_sep.2 ⟨hz, h.to_isFunc.1 hz⟩
186
-
187
- theorem eq_of_agree {A f g : ZFSet.{u}} (hf : FunctionGraphOn A f)
188
- (hg : FunctionGraphOn A g)
189
- (agree : ∀ x y z, ZFSet.pair x y ∈ f → ZFSet.pair x z ∈ g → y = z) : f = g := by
190
- apply ZFSet.ext
191
- intro z
192
- constructor
193
- · intro hz
194
- obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (hf.to_isFunc.1 hz)
195
- obtain ⟨w, hw⟩ := hg.total hx
196
- exact (agree x y w hz hw).symm ▸ hw
197
- · intro hz
198
- obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (hg.to_isFunc.1 hz)
199
- obtain ⟨w, hw⟩ := hf.total hx
200
- exact agree x w y hw hz ▸ hw
201
-
202
- theorem empty : FunctionGraphOn (∅ : ZFSet.{u}) ∅ :=
203
- ⟨∅, ZFSet.empty_subset _, fun x hx => False.elim (ZFSet.notMem_empty x hx)⟩
204
-
205
- theorem insert {A f x : ZFSet.{u}} (h : FunctionGraphOn A f) (fresh : x ∉ A)
206
- (y : ZFSet.{u}) : FunctionGraphOn (Insert.insert x A) (Insert.insert (ZFSet.pair x y) f) := by
207
- classical
208
- refine ⟨Insert.insert y (⋃₀ ⋃₀ f), ?_, ?_⟩
209
- · intro z hz
210
- rcases ZFSet.mem_insert_iff.1 hz with rfl | hz
211
- · exact ZFSet.pair_mem_prod.2
212
- ⟨ZFSet.mem_insert_iff.2 (Or.inl rfl), ZFSet.mem_insert_iff.2 (Or.inl rfl)⟩
213
- · obtain ⟨a, ha, b, hb, rfl⟩ := ZFSet.mem_prod.1 (h.to_isFunc.1 hz)
214
- exact ZFSet.pair_mem_prod.2
215
- ⟨ZFSet.mem_insert_iff.2 (Or.inr ha), ZFSet.mem_insert_iff.2 (Or.inr hb)⟩
216
- · intro a ha
217
- rcases ZFSet.mem_insert_iff.1 ha with rfl | ha
218
- · refine ⟨y, ZFSet.mem_insert_iff.2 (Or.inl rfl), ?_⟩
219
- intro b hb
220
- rcases ZFSet.mem_insert_iff.1 hb with eq | hb
221
- · exact (ZFSet.pair_inj.1 eq).2
222
- · exact False.elim (fresh (h.pair_source hb))
223
- · obtain ⟨b, entry⟩ := h.total ha
224
- refine ⟨b, ZFSet.mem_insert_iff.2 (Or.inr entry), ?_⟩
225
- intro c hc
226
- rcases ZFSet.mem_insert_iff.1 hc with eq | hc
227
- · exact False.elim (fresh ((ZFSet.pair_inj.1 eq).1 ▸ ha))
228
- · exact h.unique hc entry
229
-
230
- theorem successor {A f : ZFSet.{u}} (h : FunctionGraphOn A f) (y : ZFSet.{u}) :
231
- FunctionGraphOn (Insert.insert A A) (Insert.insert (ZFSet.pair A y) f) :=
232
- h.insert (ZFSet.mem_irrefl A) y
233
-
234
- end FunctionGraphOn
235
-
236
- theorem functionGraphOn_sUnion {A W : ZFSet.{u}}
237
- (shape : ∀ f ∈ W, ∃ B, B ⊆ A ∧ FunctionGraphOn B f)
238
- (cover : ∀ x ∈ A, ∃ f ∈ W, ∃ y, ZFSet.pair x y ∈ f)
239
- (agree : ∀ f ∈ W, ∀ g ∈ W, ∀ x y z,
240
- ZFSet.pair x y ∈ f → ZFSet.pair x z ∈ g → y = z) :
241
- FunctionGraphOn A (⋃₀ W) := by
242
- refine ⟨⋃₀ ⋃₀ (⋃₀ W), ?_, ?_⟩
243
- · intro z hz
244
- obtain ⟨f, hf, entry⟩ := ZFSet.mem_sUnion.1 hz
245
- obtain ⟨B, subset, func⟩ := shape f hf
246
- obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (func.to_isFunc.1 entry)
247
- exact ZFSet.pair_mem_prod.2 ⟨subset hx, pair_second_mem_doubleUnion hz⟩
248
- · intro x hx
249
- obtain ⟨f, hf, y, entry⟩ := cover x hx
250
- refine ⟨y, ZFSet.mem_sUnion.2 ⟨f, hf, entry⟩, ?_⟩
251
- intro z hz
252
- obtain ⟨g, hg, rel⟩ := ZFSet.mem_sUnion.1 hz
253
- exact agree g hg f hf x z y rel entry
254
-
255
- end PartitionPilot.Forcing
256
-
257
-
258
-
259
- namespace PartitionPilot.SetRealization.Presentation
260
- universe u
261
- variable {A B : Type u} (s : Presentation A) (e : B ≃ A)
262
-
263
- def reindex : Presentation B where
264
- carrier := s.carrier
265
- encode b := s.encode (e b)
266
- injective := s.injective.comp e.injective
267
- mem_carrier x := by
268
- rw [s.mem_carrier]
269
- exact ⟨fun ⟨a, eq⟩ => ⟨e.symm a, by simpa only [e.apply_symm_apply] using eq⟩,
270
- fun ⟨b, eq⟩ => ⟨e b, eq⟩⟩
271
-
272
- theorem reindex_carrier : (s.reindex e).carrier = s.carrier := rfl
273
-
274
- theorem reindex_encode (b : B) : (s.reindex e).encode b = s.encode (e b) := rfl
275
-
276
- theorem graph_reindex {C : Type u} (t : Presentation C) (f : C → B) :
277
- t.graph (s.reindex e) f = t.graph s (fun x => e (f x)) := by
278
- apply ZFSet.ext
279
- intro z
280
- rw [mem_graph, mem_graph]
281
- rfl
282
-
283
- end PartitionPilot.SetRealization.Presentation
284
-
285
-
286
-
287
- namespace PartitionPilot.Forcing
288
- universe u
289
-
290
- def NatUnionCode (stages : Nat → ZFSet.{u}) (union : ZFSet.{u}) : Prop :=
291
- ∀ x, x ∈ union ↔ ∃ n, x ∈ stages n
292
-
293
- namespace NatUnionCode
294
-
295
- theorem subset {stages : Nat → ZFSet.{u}} {union : ZFSet.{u}}
296
- (code : NatUnionCode stages union) (n : Nat) : stages n ⊆ union :=
297
- fun _ hx => (code _).2 ⟨n, hx⟩
298
-
299
- theorem constant (A : ZFSet.{u}) : NatUnionCode (fun _ => A) A := by
300
- intro x
301
- exact ⟨fun hx => ⟨0, hx⟩, fun ⟨_, hx⟩ => hx⟩
302
-
303
- theorem prod_left {stages : Nat → ZFSet.{u}} {union : ZFSet.{u}}
304
- (code : NatUnionCode stages union) (A : ZFSet.{u}) :
305
- NatUnionCode (fun n => ZFSet.prod A (stages n)) (ZFSet.prod A union) := by
306
- intro z
307
- constructor
308
- · rintro hz
309
- obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz
310
- obtain ⟨n, hn⟩ := (code y).1 hy
311
- exact ⟨n, ZFSet.pair_mem_prod.2 ⟨hx, hn⟩⟩
312
- · rintro ⟨n, hn⟩
313
- obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hn
314
- exact ZFSet.pair_mem_prod.2 ⟨hx, code.subset n hy⟩
315
-
316
- theorem prod {A B : Nat → ZFSet.{u}} {U V : ZFSet.{u}}
317
- (left : NatUnionCode A U) (right : NatUnionCode B V)
318
- (leftMono : ∀ n m, n ≤ m → A n ⊆ A m)
319
- (rightMono : ∀ n m, n ≤ m → B n ⊆ B m) :
320
- NatUnionCode (fun n => ZFSet.prod (A n) (B n)) (ZFSet.prod U V) := by
321
- intro z
322
- constructor
323
- · intro hz
324
- obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz
325
- obtain ⟨n, hn⟩ := (left x).1 hx
326
- obtain ⟨m, hm⟩ := (right y).1 hy
327
- exact ⟨max n m, ZFSet.pair_mem_prod.2
328
- ⟨leftMono n _ (le_max_left n m) hn, rightMono m _ (le_max_right n m) hm⟩⟩
329
- · rintro ⟨n, hn⟩
330
- obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hn
331
- exact ZFSet.pair_mem_prod.2 ⟨left.subset n hx, right.subset n hy⟩
332
-
333
- theorem isFunc {A B f : Nat → ZFSet.{u}} {U V F : ZFSet.{u}}
334
- (domain : NatUnionCode A U) (range : NatUnionCode B V) (graph : NatUnionCode f F)
335
- (functions : ∀ n, ZFSet.IsFunc (A n) (B n) (f n))
336
- (graphMono : ∀ n m, n ≤ m → f n ⊆ f m) : ZFSet.IsFunc U V F := by
337
- constructor
338
- · intro z hz
339
- obtain ⟨n, hn⟩ := (graph z).1 hz
340
- obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 ((functions n).1 hn)
341
- exact ZFSet.pair_mem_prod.2 ⟨domain.subset n hx, range.subset n hy⟩
342
- · intro x hx
343
- obtain ⟨n, hn⟩ := (domain x).1 hx
344
- obtain ⟨y, entry, _⟩ := (functions n).2 x hn
345
- refine ⟨y, graph.subset n entry, ?_⟩
346
- intro z hz
347
- obtain ⟨m, hm⟩ := (graph _).1 hz
348
- have first := graphMono n (max n m) (le_max_left n m) entry
349
- have second := graphMono m (max n m) (le_max_right n m) hm
350
- have inDomain := (ZFSet.pair_mem_prod.1 ((functions (max n m)).1 first)).1
351
- obtain ⟨_, _, unique⟩ := (functions (max n m)).2 x inDomain
352
- exact (unique z second).trans (unique y first).symm
353
-
354
- theorem function_entry_iff {A B f : Nat → ZFSet.{u}} {U V F : ZFSet.{u}}
355
- (graph : NatUnionCode f F) (function : ZFSet.IsFunc U V F)
356
- (functions : ∀ n, ZFSet.IsFunc (A n) (B n) (f n))
357
- (n : Nat) {x y : ZFSet.{u}} (hx : x ∈ A n) :
358
- ZFSet.pair x y ∈ F ↔ ZFSet.pair x y ∈ f n := by
359
- constructor
360
- · intro entry
361
- obtain ⟨z, old, _⟩ := (functions n).2 x hx
362
- have oldUnion := graph.subset n old
363
- have inDomain := (ZFSet.pair_mem_prod.1 (function.1 oldUnion)).1
364
- obtain ⟨_, _, unique⟩ := function.2 x inDomain
365
- have equal : y = z := (unique y entry).trans (unique z oldUnion).symm
366
- exact equal.symm ▸ old
367
- · exact fun entry => graph.subset n entry
368
-
369
- end NatUnionCode
370
-
371
- end PartitionPilot.Forcing
372
-
373
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Transfinite.SetRankBounds
2
+
3
+ namespace OAI
4
+
5
+
6
+ namespace PartitionPilot.SetRealization.Presentation
7
+
8
+ universe u
9
+ variable {A B : Type u} (s : Presentation A) (t : Presentation B) (f : A → B)
10
+
11
+ noncomputable def graph : ZFSet.{u} :=
12
+ (s.product t).subset (fun a => f a.1 = a.2)
13
+
14
+ theorem pair_mem_graph (a : A) (b : B) :
15
+ ZFSet.pair (s.encode a) (t.encode b) ∈ s.graph t f ↔ f a = b :=
16
+ (s.product t).encode_mem_subset (fun a => f a.1 = a.2) (a, b)
17
+
18
+ theorem mem_graph (x : ZFSet.{u}) :
19
+ x ∈ s.graph t f ↔ ∃ a, ZFSet.pair (s.encode a) (t.encode (f a)) = x := by
20
+ rw [graph, mem_subset]
21
+ constructor
22
+ · rintro ⟨⟨a, b⟩, h, eq⟩
23
+ change f a = b at h
24
+ subst b
25
+ exact ⟨a, eq⟩
26
+ · rintro ⟨a, eq⟩
27
+ exact ⟨(a, f a), rfl, eq⟩
28
+
29
+ theorem graph_isFunc : ZFSet.IsFunc s.carrier t.carrier (s.graph t f) := by
30
+ refine ⟨(s.product t).subset_carrier _, ?_⟩
31
+ intro x hx
32
+ rcases (s.mem_carrier x).1 hx with ⟨a, rfl⟩
33
+ refine ⟨t.encode (f a), (s.pair_mem_graph t f a (f a)).2 rfl, ?_⟩
34
+ intro y hy
35
+ rcases (s.mem_graph t f _).1 hy with ⟨b, eq⟩
36
+ have parts := ZFSet.pair_inj.1 eq
37
+ have ba := s.injective parts.1
38
+ simpa only [ba] using parts.2.symm
39
+
40
+ theorem graph_mem_funs : s.graph t f ∈ ZFSet.funs s.carrier t.carrier :=
41
+ ZFSet.mem_funs.2 (s.graph_isFunc t f)
42
+
43
+ theorem graph_rank_lt {o : Ordinal.{u}} (limit : Order.IsSuccLimit o)
44
+ (hs : ZFSet.rank s.carrier < o) (ht : ZFSet.rank t.carrier < o) :
45
+ ZFSet.rank (s.graph t f) < o :=
46
+ (s.product t).subset_rank_lt (s.product_rank_lt limit t hs ht) _
47
+
48
+ end PartitionPilot.SetRealization.Presentation
49
+
50
+
51
+
52
+ namespace PartitionPilot.Forcing
53
+
54
+ open scoped ZFSet
55
+
56
+ universe u
57
+
58
+ def FunctionGraphOn (A f : ZFSet.{u}) : Prop :=
59
+ ∃ B, ZFSet.IsFunc A B f
60
+
61
+ def graphRestriction (A f : ZFSet.{u}) : ZFSet.{u} :=
62
+ ZFSet.sep (fun z => z ∈ ZFSet.prod A (⋃₀ ⋃₀ f)) f
63
+
64
+ theorem pair_first_mem_doubleUnion {x y f : ZFSet.{u}}
65
+ (entry : ZFSet.pair x y ∈ f) : x ∈ ⋃₀ ⋃₀ f := by
66
+ exact ZFSet.mem_sUnion.2 ⟨{x}, ZFSet.mem_sUnion.2
67
+ ⟨ZFSet.pair x y, entry, ZFSet.mem_pair.2 (Or.inl rfl)⟩,
68
+ ZFSet.mem_singleton.2 rfl⟩
69
+
70
+ theorem pair_second_mem_doubleUnion {x y f : ZFSet.{u}}
71
+ (entry : ZFSet.pair x y ∈ f) : y ∈ ⋃₀ ⋃₀ f := by
72
+ exact ZFSet.mem_sUnion.2 ⟨{x, y}, ZFSet.mem_sUnion.2
73
+ ⟨ZFSet.pair x y, entry, ZFSet.mem_pair.2 (Or.inr rfl)⟩,
74
+ ZFSet.mem_pair.2 (Or.inr rfl)⟩
75
+
76
+ theorem pair_mem_graphRestriction {A f x y : ZFSet.{u}} :
77
+ ZFSet.pair x y ∈ graphRestriction A f ↔ ZFSet.pair x y ∈ f ∧ x ∈ A := by
78
+ constructor
79
+ · intro h
80
+ exact ⟨(ZFSet.mem_sep.1 h).1, (ZFSet.pair_mem_prod.1 (ZFSet.mem_sep.1 h).2).1⟩
81
+ · rintro ⟨entry, hx⟩
82
+ exact ZFSet.mem_sep.2 ⟨entry, ZFSet.pair_mem_prod.2
83
+ ⟨hx, pair_second_mem_doubleUnion entry⟩⟩
84
+
85
+ theorem mem_graphRestriction {A f z : ZFSet.{u}} :
86
+ z ∈ graphRestriction A f ↔ ∃ x ∈ A, ∃ y, z = ZFSet.pair x y ∧ ZFSet.pair x y ∈ f := by
87
+ constructor
88
+ · intro h
89
+ obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 h).2
90
+ exact ⟨x, hx, y, rfl, (ZFSet.mem_sep.1 h).1⟩
91
+ · rintro ⟨x, hx, y, rfl, entry⟩
92
+ exact pair_mem_graphRestriction.2 ⟨entry, hx⟩
93
+
94
+ theorem graphRestriction_subset (A f : ZFSet.{u}) : graphRestriction A f ⊆ f :=
95
+ fun _ h => (ZFSet.mem_sep.1 h).1
96
+
97
+ theorem graphRestriction_restrict {A B f : ZFSet.{u}} (subset : B ⊆ A) :
98
+ graphRestriction B (graphRestriction A f) = graphRestriction B f := by
99
+ apply ZFSet.ext
100
+ intro z
101
+ constructor
102
+ · intro hz
103
+ obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz
104
+ exact pair_mem_graphRestriction.2 ⟨(pair_mem_graphRestriction.1 entry).1, hx⟩
105
+ · intro hz
106
+ obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz
107
+ exact pair_mem_graphRestriction.2
108
+ ⟨pair_mem_graphRestriction.2 ⟨entry, subset hx⟩, hx⟩
109
+
110
+ theorem graphRestriction_eq_sep {A B C f : ZFSet.{u}} (h : ZFSet.IsFunc A B f) :
111
+ graphRestriction C f = ZFSet.sep (fun z => z ∈ ZFSet.prod C B) f := by
112
+ apply ZFSet.ext
113
+ intro z
114
+ constructor
115
+ · intro hz
116
+ obtain ⟨x, hx, y, rfl, entry⟩ := mem_graphRestriction.1 hz
117
+ exact ZFSet.mem_sep.2 ⟨entry, ZFSet.pair_mem_prod.2
118
+ ⟨hx, (ZFSet.pair_mem_prod.1 (h.1 entry)).2⟩⟩
119
+ · intro hz
120
+ obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.mem_sep.1 hz).2
121
+ exact pair_mem_graphRestriction.2 ⟨(ZFSet.mem_sep.1 hz).1, hx⟩
122
+
123
+ theorem graphRestriction_insert_of_not_mem {A f x y : ZFSet.{u}} (fresh : x ∉ A) :
124
+ graphRestriction A (insert (ZFSet.pair x y) f) = graphRestriction A f := by
125
+ apply ZFSet.ext
126
+ intro z
127
+ constructor
128
+ · intro hz
129
+ obtain ⟨a, ha, b, rfl, entry⟩ := mem_graphRestriction.1 hz
130
+ rcases ZFSet.mem_insert_iff.1 entry with eq | entry
131
+ · exact False.elim (fresh ((ZFSet.pair_inj.1 eq).1 ▸ ha))
132
+ · exact pair_mem_graphRestriction.2 ⟨entry, ha⟩
133
+ · intro hz
134
+ obtain ⟨a, ha, b, rfl, entry⟩ := mem_graphRestriction.1 hz
135
+ exact pair_mem_graphRestriction.2 ⟨ZFSet.mem_insert_iff.2 (Or.inr entry), ha⟩
136
+
137
+ namespace FunctionGraphOn
138
+
139
+ theorem to_isFunc {A f : ZFSet.{u}} (h : FunctionGraphOn A f) :
140
+ ZFSet.IsFunc A (⋃₀ ⋃₀ f) f := by
141
+ obtain ⟨B, shape, total⟩ := h
142
+ refine ⟨?_, total⟩
143
+ intro z hz
144
+ obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (shape hz)
145
+ exact ZFSet.pair_mem_prod.2 ⟨hx, pair_second_mem_doubleUnion hz⟩
146
+
147
+ theorem shape {A f : ZFSet.{u}} (h : FunctionGraphOn A f) :
148
+ ∀ z ∈ f, ∃ x ∈ A, ∃ y, z = ZFSet.pair x y := by
149
+ intro z hz
150
+ obtain ⟨x, hx, y, _, eq⟩ := ZFSet.mem_prod.1 (h.to_isFunc.1 hz)
151
+ exact ⟨x, hx, y, eq⟩
152
+
153
+ theorem total {A f x : ZFSet.{u}} (h : FunctionGraphOn A f) (hx : x ∈ A) :
154
+ ∃ y, ZFSet.pair x y ∈ f := by
155
+ obtain ⟨y, entry, _⟩ := h.to_isFunc.2 x hx
156
+ exact ⟨y, entry⟩
157
+
158
+ theorem pair_source {A f x y : ZFSet.{u}} (h : FunctionGraphOn A f)
159
+ (entry : ZFSet.pair x y ∈ f) : x ∈ A :=
160
+ (ZFSet.pair_mem_prod.1 (h.to_isFunc.1 entry)).1
161
+
162
+ theorem unique {A f x y z : ZFSet.{u}} (h : FunctionGraphOn A f)
163
+ (hy : ZFSet.pair x y ∈ f) (hz : ZFSet.pair x z ∈ f) : y = z := by
164
+ obtain ⟨w, _, unique⟩ := h.to_isFunc.2 x (h.pair_source hy)
165
+ exact (unique y hy).trans (unique z hz).symm
166
+
167
+ theorem restrict {A B f : ZFSet.{u}} (h : FunctionGraphOn A f) (subset : B ⊆ A) :
168
+ FunctionGraphOn B (graphRestriction B f) := by
169
+ refine ⟨⋃₀ ⋃₀ f, ?_, ?_⟩
170
+ · intro z hz
171
+ exact (ZFSet.mem_sep.1 hz).2
172
+ · intro x hx
173
+ obtain ⟨y, entry⟩ := h.total (subset hx)
174
+ refine ⟨y, pair_mem_graphRestriction.2 ⟨entry, hx⟩, ?_⟩
175
+ intro z hz
176
+ exact h.unique (pair_mem_graphRestriction.1 hz).1 entry
177
+
178
+ theorem restriction_eq {A f : ZFSet.{u}} (h : FunctionGraphOn A f) :
179
+ graphRestriction A f = f := by
180
+ apply ZFSet.ext
181
+ intro z
182
+ constructor
183
+ · exact fun hz => graphRestriction_subset A f hz
184
+ · intro hz
185
+ exact ZFSet.mem_sep.2 ⟨hz, h.to_isFunc.1 hz⟩
186
+
187
+ theorem eq_of_agree {A f g : ZFSet.{u}} (hf : FunctionGraphOn A f)
188
+ (hg : FunctionGraphOn A g)
189
+ (agree : ∀ x y z, ZFSet.pair x y ∈ f → ZFSet.pair x z ∈ g → y = z) : f = g := by
190
+ apply ZFSet.ext
191
+ intro z
192
+ constructor
193
+ · intro hz
194
+ obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (hf.to_isFunc.1 hz)
195
+ obtain ⟨w, hw⟩ := hg.total hx
196
+ exact (agree x y w hz hw).symm ▸ hw
197
+ · intro hz
198
+ obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (hg.to_isFunc.1 hz)
199
+ obtain ⟨w, hw⟩ := hf.total hx
200
+ exact agree x w y hw hz ▸ hw
201
+
202
+ theorem empty : FunctionGraphOn (∅ : ZFSet.{u}) ∅ :=
203
+ ⟨∅, ZFSet.empty_subset _, fun x hx => False.elim (ZFSet.notMem_empty x hx)⟩
204
+
205
+ theorem insert {A f x : ZFSet.{u}} (h : FunctionGraphOn A f) (fresh : x ∉ A)
206
+ (y : ZFSet.{u}) : FunctionGraphOn (Insert.insert x A) (Insert.insert (ZFSet.pair x y) f) := by
207
+ classical
208
+ refine ⟨Insert.insert y (⋃₀ ⋃₀ f), ?_, ?_⟩
209
+ · intro z hz
210
+ rcases ZFSet.mem_insert_iff.1 hz with rfl | hz
211
+ · exact ZFSet.pair_mem_prod.2
212
+ ⟨ZFSet.mem_insert_iff.2 (Or.inl rfl), ZFSet.mem_insert_iff.2 (Or.inl rfl)⟩
213
+ · obtain ⟨a, ha, b, hb, rfl⟩ := ZFSet.mem_prod.1 (h.to_isFunc.1 hz)
214
+ exact ZFSet.pair_mem_prod.2
215
+ ⟨ZFSet.mem_insert_iff.2 (Or.inr ha), ZFSet.mem_insert_iff.2 (Or.inr hb)⟩
216
+ · intro a ha
217
+ rcases ZFSet.mem_insert_iff.1 ha with rfl | ha
218
+ · refine ⟨y, ZFSet.mem_insert_iff.2 (Or.inl rfl), ?_⟩
219
+ intro b hb
220
+ rcases ZFSet.mem_insert_iff.1 hb with eq | hb
221
+ · exact (ZFSet.pair_inj.1 eq).2
222
+ · exact False.elim (fresh (h.pair_source hb))
223
+ · obtain ⟨b, entry⟩ := h.total ha
224
+ refine ⟨b, ZFSet.mem_insert_iff.2 (Or.inr entry), ?_⟩
225
+ intro c hc
226
+ rcases ZFSet.mem_insert_iff.1 hc with eq | hc
227
+ · exact False.elim (fresh ((ZFSet.pair_inj.1 eq).1 ▸ ha))
228
+ · exact h.unique hc entry
229
+
230
+ theorem successor {A f : ZFSet.{u}} (h : FunctionGraphOn A f) (y : ZFSet.{u}) :
231
+ FunctionGraphOn (Insert.insert A A) (Insert.insert (ZFSet.pair A y) f) :=
232
+ h.insert (ZFSet.mem_irrefl A) y
233
+
234
+ end FunctionGraphOn
235
+
236
+ theorem functionGraphOn_sUnion {A W : ZFSet.{u}}
237
+ (shape : ∀ f ∈ W, ∃ B, B ⊆ A ∧ FunctionGraphOn B f)
238
+ (cover : ∀ x ∈ A, ∃ f ∈ W, ∃ y, ZFSet.pair x y ∈ f)
239
+ (agree : ∀ f ∈ W, ∀ g ∈ W, ∀ x y z,
240
+ ZFSet.pair x y ∈ f → ZFSet.pair x z ∈ g → y = z) :
241
+ FunctionGraphOn A (⋃₀ W) := by
242
+ refine ⟨⋃₀ ⋃₀ (⋃₀ W), ?_, ?_⟩
243
+ · intro z hz
244
+ obtain ⟨f, hf, entry⟩ := ZFSet.mem_sUnion.1 hz
245
+ obtain ⟨B, subset, func⟩ := shape f hf
246
+ obtain ⟨x, hx, y, _, rfl⟩ := ZFSet.mem_prod.1 (func.to_isFunc.1 entry)
247
+ exact ZFSet.pair_mem_prod.2 ⟨subset hx, pair_second_mem_doubleUnion hz⟩
248
+ · intro x hx
249
+ obtain ⟨f, hf, y, entry⟩ := cover x hx
250
+ refine ⟨y, ZFSet.mem_sUnion.2 ⟨f, hf, entry⟩, ?_⟩
251
+ intro z hz
252
+ obtain ⟨g, hg, rel⟩ := ZFSet.mem_sUnion.1 hz
253
+ exact agree g hg f hf x z y rel entry
254
+
255
+ end PartitionPilot.Forcing
256
+
257
+
258
+
259
+ namespace PartitionPilot.SetRealization.Presentation
260
+ universe u
261
+ variable {A B : Type u} (s : Presentation A) (e : B ≃ A)
262
+
263
+ def reindex : Presentation B where
264
+ carrier := s.carrier
265
+ encode b := s.encode (e b)
266
+ injective := s.injective.comp e.injective
267
+ mem_carrier x := by
268
+ rw [s.mem_carrier]
269
+ exact ⟨fun ⟨a, eq⟩ => ⟨e.symm a, by simpa only [e.apply_symm_apply] using eq⟩,
270
+ fun ⟨b, eq⟩ => ⟨e b, eq⟩⟩
271
+
272
+ theorem reindex_carrier : (s.reindex e).carrier = s.carrier := rfl
273
+
274
+ theorem reindex_encode (b : B) : (s.reindex e).encode b = s.encode (e b) := rfl
275
+
276
+ theorem graph_reindex {C : Type u} (t : Presentation C) (f : C → B) :
277
+ t.graph (s.reindex e) f = t.graph s (fun x => e (f x)) := by
278
+ apply ZFSet.ext
279
+ intro z
280
+ rw [mem_graph, mem_graph]
281
+ rfl
282
+
283
+ end PartitionPilot.SetRealization.Presentation
284
+
285
+
286
+
287
+ namespace PartitionPilot.Forcing
288
+ universe u
289
+
290
+ def NatUnionCode (stages : Nat → ZFSet.{u}) (union : ZFSet.{u}) : Prop :=
291
+ ∀ x, x ∈ union ↔ ∃ n, x ∈ stages n
292
+
293
+ namespace NatUnionCode
294
+
295
+ theorem subset {stages : Nat → ZFSet.{u}} {union : ZFSet.{u}}
296
+ (code : NatUnionCode stages union) (n : Nat) : stages n ⊆ union :=
297
+ fun _ hx => (code _).2 ⟨n, hx⟩
298
+
299
+ theorem constant (A : ZFSet.{u}) : NatUnionCode (fun _ => A) A := by
300
+ intro x
301
+ exact ⟨fun hx => ⟨0, hx⟩, fun ⟨_, hx⟩ => hx⟩
302
+
303
+ theorem prod_left {stages : Nat → ZFSet.{u}} {union : ZFSet.{u}}
304
+ (code : NatUnionCode stages union) (A : ZFSet.{u}) :
305
+ NatUnionCode (fun n => ZFSet.prod A (stages n)) (ZFSet.prod A union) := by
306
+ intro z
307
+ constructor
308
+ · rintro hz
309
+ obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz
310
+ obtain ⟨n, hn⟩ := (code y).1 hy
311
+ exact ⟨n, ZFSet.pair_mem_prod.2 ⟨hx, hn⟩⟩
312
+ · rintro ⟨n, hn⟩
313
+ obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hn
314
+ exact ZFSet.pair_mem_prod.2 ⟨hx, code.subset n hy⟩
315
+
316
+ theorem prod {A B : Nat → ZFSet.{u}} {U V : ZFSet.{u}}
317
+ (left : NatUnionCode A U) (right : NatUnionCode B V)
318
+ (leftMono : ∀ n m, n ≤ m → A n ⊆ A m)
319
+ (rightMono : ∀ n m, n ≤ m → B n ⊆ B m) :
320
+ NatUnionCode (fun n => ZFSet.prod (A n) (B n)) (ZFSet.prod U V) := by
321
+ intro z
322
+ constructor
323
+ · intro hz
324
+ obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hz
325
+ obtain ⟨n, hn⟩ := (left x).1 hx
326
+ obtain ⟨m, hm⟩ := (right y).1 hy
327
+ exact ⟨max n m, ZFSet.pair_mem_prod.2
328
+ ⟨leftMono n _ (le_max_left n m) hn, rightMono m _ (le_max_right n m) hm⟩⟩
329
+ · rintro ⟨n, hn⟩
330
+ obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hn
331
+ exact ZFSet.pair_mem_prod.2 ⟨left.subset n hx, right.subset n hy⟩
332
+
333
+ theorem isFunc {A B f : Nat → ZFSet.{u}} {U V F : ZFSet.{u}}
334
+ (domain : NatUnionCode A U) (range : NatUnionCode B V) (graph : NatUnionCode f F)
335
+ (functions : ∀ n, ZFSet.IsFunc (A n) (B n) (f n))
336
+ (graphMono : ∀ n m, n ≤ m → f n ⊆ f m) : ZFSet.IsFunc U V F := by
337
+ constructor
338
+ · intro z hz
339
+ obtain ⟨n, hn⟩ := (graph z).1 hz
340
+ obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 ((functions n).1 hn)
341
+ exact ZFSet.pair_mem_prod.2 ⟨domain.subset n hx, range.subset n hy⟩
342
+ · intro x hx
343
+ obtain ⟨n, hn⟩ := (domain x).1 hx
344
+ obtain ⟨y, entry, _⟩ := (functions n).2 x hn
345
+ refine ⟨y, graph.subset n entry, ?_⟩
346
+ intro z hz
347
+ obtain ⟨m, hm⟩ := (graph _).1 hz
348
+ have first := graphMono n (max n m) (le_max_left n m) entry
349
+ have second := graphMono m (max n m) (le_max_right n m) hm
350
+ have inDomain := (ZFSet.pair_mem_prod.1 ((functions (max n m)).1 first)).1
351
+ obtain ⟨_, _, unique⟩ := (functions (max n m)).2 x inDomain
352
+ exact (unique z second).trans (unique y first).symm
353
+
354
+ theorem function_entry_iff {A B f : Nat → ZFSet.{u}} {U V F : ZFSet.{u}}
355
+ (graph : NatUnionCode f F) (function : ZFSet.IsFunc U V F)
356
+ (functions : ∀ n, ZFSet.IsFunc (A n) (B n) (f n))
357
+ (n : Nat) {x y : ZFSet.{u}} (hx : x ∈ A n) :
358
+ ZFSet.pair x y ∈ F ↔ ZFSet.pair x y ∈ f n := by
359
+ constructor
360
+ · intro entry
361
+ obtain ⟨z, old, _⟩ := (functions n).2 x hx
362
+ have oldUnion := graph.subset n old
363
+ have inDomain := (ZFSet.pair_mem_prod.1 (function.1 oldUnion)).1
364
+ obtain ⟨_, _, unique⟩ := function.2 x inDomain
365
+ have equal : y = z := (unique y entry).trans (unique z oldUnion).symm
366
+ exact equal.symm ▸ old
367
+ · exact fun entry => graph.subset n entry
368
+
369
+ end NatUnionCode
370
+
371
+ end PartitionPilot.Forcing
372
+
373
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/NaturalSetCodes.lean CHANGED
@@ -1,149 +1,149 @@
1
- import OAI.SetTheory.PartitionPrinciple.Forcing.OrbitPairGraphNames
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.SetRealization
8
-
9
- universe u
10
-
11
- def SetMembers (Q : ZFSet.{u}) : Type u := Shrink Q
12
-
13
- namespace SetMembers
14
-
15
- noncomputable def raw {Q : ZFSet.{u}} (x : SetMembers Q) : ZFSet.{u} :=
16
- ((equivShrink.{u} Q).symm x).val
17
-
18
- theorem raw_mem {Q : ZFSet.{u}} (x : SetMembers Q) : raw x ∈ Q :=
19
- ((equivShrink.{u} Q).symm x).property
20
-
21
- theorem raw_injective (Q : ZFSet.{u}) : Function.Injective (@raw Q) := by
22
- intro x y eq
23
- apply (equivShrink.{u} Q).symm.injective
24
- exact Subtype.ext eq
25
-
26
- noncomputable def ofMem {Q : ZFSet.{u}} (x : ZFSet.{u}) (hx : x ∈ Q) : SetMembers Q :=
27
- equivShrink.{u} Q ⟨x, hx⟩
28
-
29
- theorem raw_ofMem {Q : ZFSet.{u}} (x : ZFSet.{u}) (hx : x ∈ Q) : raw (ofMem x hx) = x := by
30
- exact congrArg Subtype.val ((equivShrink.{u} Q).symm_apply_apply ⟨x, hx⟩)
31
-
32
- theorem ofMem_raw {Q : ZFSet.{u}} (x : SetMembers Q) : ofMem (raw x) (raw_mem x) = x :=
33
- (equivShrink.{u} Q).apply_symm_apply x
34
-
35
- noncomputable def presentation (Q : ZFSet.{u}) : Presentation (SetMembers Q) where
36
- carrier := Q
37
- encode := raw
38
- injective := raw_injective Q
39
- mem_carrier x := ⟨fun hx => ⟨ofMem x hx, raw_ofMem x hx⟩,
40
- fun ⟨a, eq⟩ => eq ▸ raw_mem a⟩
41
-
42
- end SetMembers
43
-
44
- end PartitionPilot.SetRealization
45
-
46
- namespace PartitionPilot.Forcing.TransitiveGround
47
-
48
- open SetRealization
49
- universe u
50
- variable (M : TransitiveGround.{u})
51
-
52
- theorem setMember_ground {Q : ZFSet.{u}} (hQ : Q ∈ M.sets) (x : SetMembers Q) :
53
- SetMembers.raw x ∈ M.sets := M.transitive hQ (SetMembers.raw_mem x)
54
-
55
- theorem setMembers_countable (small : M.sets.Countable) {Q : ZFSet.{u}} (hQ : Q ∈ M.sets) :
56
- Countable (SetMembers Q) := M.conditions_countable (SetMembers.presentation Q) small hQ
57
-
58
- end PartitionPilot.Forcing.TransitiveGround
59
-
60
-
61
-
62
- namespace PartitionPilot.Forcing
63
-
64
- universe u
65
-
66
- def natSetCode (n : Nat) : ZFSet.{u} := ZFSet.mk (PSet.ofNat n)
67
-
68
- theorem natSetCode_zero : natSetCode 0 = (∅ : ZFSet.{u}) := rfl
69
-
70
- theorem natSetCode_succ (n : Nat) :
71
- natSetCode (n + 1) = insert (natSetCode n) (natSetCode n) := rfl
72
-
73
- theorem mem_omega_iff_natSetCode (x : ZFSet.{u}) :
74
- x ∈ ZFSet.omega ↔ ∃ n, x = natSetCode n := by
75
- induction x using Quotient.inductionOn with
76
- | h x =>
77
- constructor
78
- · rintro ⟨⟨n⟩, h⟩
79
- exact ⟨n, ZFSet.sound h⟩
80
- · rintro ⟨n, h⟩
81
- exact ⟨⟨n⟩, ZFSet.exact h⟩
82
-
83
- theorem natSetCode_mem_omega (n : Nat) : natSetCode n ∈ ZFSet.omega.{u} :=
84
- (mem_omega_iff_natSetCode _).2 ⟨n, rfl⟩
85
-
86
- def zeroOrSuccessor (x : ZFSet.{u}) : Prop :=
87
- x = ∅ ∨ ∃ y ∈ x, x = insert y y
88
-
89
- def naturalSetProperty (x : ZFSet.{u}) : Prop :=
90
- setTransitive x ∧ zeroOrSuccessor x ∧
91
- ∀ y ∈ x, setTransitive y ∧ zeroOrSuccessor y
92
-
93
- theorem naturalSetProperty_empty : naturalSetProperty (∅ : ZFSet.{u}) := by
94
- refine ⟨?_, Or.inl rfl, ?_⟩
95
- · intro y hy
96
- exact False.elim (ZFSet.notMem_empty y hy)
97
- · intro y hy
98
- exact False.elim (ZFSet.notMem_empty y hy)
99
-
100
- theorem naturalSetProperty_succ {x : ZFSet.{u}} (h : naturalSetProperty x) :
101
- naturalSetProperty (insert x x) := by
102
- refine ⟨?_, Or.inr ⟨x, ZFSet.mem_insert x x, rfl⟩, ?_⟩
103
- · intro y hy z hz
104
- rcases ZFSet.mem_insert_iff.1 hy with rfl | hy
105
- · exact ZFSet.mem_insert_of_mem _ hz
106
- · exact ZFSet.mem_insert_of_mem x (h.1 y hy z hz)
107
- · intro y hy
108
- rcases ZFSet.mem_insert_iff.1 hy with rfl | hy
109
- · exact ⟨h.1, h.2.1⟩
110
- · exact h.2.2 y hy
111
-
112
- theorem naturalSetProperty_member {x y : ZFSet.{u}}
113
- (h : naturalSetProperty x) (hy : y ∈ x) : naturalSetProperty y := by
114
- have facts := h.2.2 y hy
115
- exact ⟨facts.1, facts.2, fun z hz => h.2.2 z (h.1 y hy z hz)⟩
116
-
117
- theorem naturalSetProperty_iff (x : ZFSet.{u}) :
118
- naturalSetProperty x ↔ ∃ n, x = natSetCode n := by
119
- constructor
120
- · induction x using ZFSet.inductionOn with
121
- | h x ih =>
122
- intro hx
123
- rcases hx.2.1 with empty | ⟨y, hy, succ⟩
124
- · exact ⟨0, empty⟩
125
- · obtain ⟨n, eq⟩ := ih y hy (naturalSetProperty_member hx hy)
126
- exact ⟨n + 1, by rw [succ, eq]; rfl⟩
127
- · rintro ⟨n, rfl⟩
128
- induction n with
129
- | zero => exact naturalSetProperty_empty
130
- | succ n ih => exact naturalSetProperty_succ ih
131
-
132
- theorem naturalSetProperty_iff_mem_omega (x : ZFSet.{u}) :
133
- naturalSetProperty x ↔ x ∈ ZFSet.omega :=
134
- (naturalSetProperty_iff x).trans (mem_omega_iff_natSetCode x).symm
135
-
136
- instance omegaMembers_countable : Countable (SetRealization.SetMembers ZFSet.omega.{u}) := by
137
- let f (n : Nat) := SetRealization.SetMembers.ofMem (natSetCode n) (natSetCode_mem_omega n)
138
- have onto : Function.Surjective f := by
139
- intro x
140
- obtain ⟨n, eq⟩ := (mem_omega_iff_natSetCode _).1 (SetRealization.SetMembers.raw_mem x)
141
- refine ⟨n, SetRealization.SetMembers.raw_injective _ ?_⟩
142
- exact (SetRealization.SetMembers.raw_ofMem _ _).trans eq.symm
143
- exact onto.countable
144
-
145
- end PartitionPilot.Forcing
146
-
147
- end
148
-
149
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Forcing.OrbitPairGraphNames
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.SetRealization
8
+
9
+ universe u
10
+
11
+ def SetMembers (Q : ZFSet.{u}) : Type u := Shrink Q
12
+
13
+ namespace SetMembers
14
+
15
+ noncomputable def raw {Q : ZFSet.{u}} (x : SetMembers Q) : ZFSet.{u} :=
16
+ ((equivShrink.{u} Q).symm x).val
17
+
18
+ theorem raw_mem {Q : ZFSet.{u}} (x : SetMembers Q) : raw x ∈ Q :=
19
+ ((equivShrink.{u} Q).symm x).property
20
+
21
+ theorem raw_injective (Q : ZFSet.{u}) : Function.Injective (@raw Q) := by
22
+ intro x y eq
23
+ apply (equivShrink.{u} Q).symm.injective
24
+ exact Subtype.ext eq
25
+
26
+ noncomputable def ofMem {Q : ZFSet.{u}} (x : ZFSet.{u}) (hx : x ∈ Q) : SetMembers Q :=
27
+ equivShrink.{u} Q ⟨x, hx⟩
28
+
29
+ theorem raw_ofMem {Q : ZFSet.{u}} (x : ZFSet.{u}) (hx : x ∈ Q) : raw (ofMem x hx) = x := by
30
+ exact congrArg Subtype.val ((equivShrink.{u} Q).symm_apply_apply ⟨x, hx⟩)
31
+
32
+ theorem ofMem_raw {Q : ZFSet.{u}} (x : SetMembers Q) : ofMem (raw x) (raw_mem x) = x :=
33
+ (equivShrink.{u} Q).apply_symm_apply x
34
+
35
+ noncomputable def presentation (Q : ZFSet.{u}) : Presentation (SetMembers Q) where
36
+ carrier := Q
37
+ encode := raw
38
+ injective := raw_injective Q
39
+ mem_carrier x := ⟨fun hx => ⟨ofMem x hx, raw_ofMem x hx⟩,
40
+ fun ⟨a, eq⟩ => eq ▸ raw_mem a⟩
41
+
42
+ end SetMembers
43
+
44
+ end PartitionPilot.SetRealization
45
+
46
+ namespace PartitionPilot.Forcing.TransitiveGround
47
+
48
+ open SetRealization
49
+ universe u
50
+ variable (M : TransitiveGround.{u})
51
+
52
+ theorem setMember_ground {Q : ZFSet.{u}} (hQ : Q ∈ M.sets) (x : SetMembers Q) :
53
+ SetMembers.raw x ∈ M.sets := M.transitive hQ (SetMembers.raw_mem x)
54
+
55
+ theorem setMembers_countable (small : M.sets.Countable) {Q : ZFSet.{u}} (hQ : Q ∈ M.sets) :
56
+ Countable (SetMembers Q) := M.conditions_countable (SetMembers.presentation Q) small hQ
57
+
58
+ end PartitionPilot.Forcing.TransitiveGround
59
+
60
+
61
+
62
+ namespace PartitionPilot.Forcing
63
+
64
+ universe u
65
+
66
+ def natSetCode (n : Nat) : ZFSet.{u} := ZFSet.mk (PSet.ofNat n)
67
+
68
+ theorem natSetCode_zero : natSetCode 0 = (∅ : ZFSet.{u}) := rfl
69
+
70
+ theorem natSetCode_succ (n : Nat) :
71
+ natSetCode (n + 1) = insert (natSetCode n) (natSetCode n) := rfl
72
+
73
+ theorem mem_omega_iff_natSetCode (x : ZFSet.{u}) :
74
+ x ∈ ZFSet.omega ↔ ∃ n, x = natSetCode n := by
75
+ induction x using Quotient.inductionOn with
76
+ | h x =>
77
+ constructor
78
+ · rintro ⟨⟨n⟩, h⟩
79
+ exact ⟨n, ZFSet.sound h⟩
80
+ · rintro ⟨n, h⟩
81
+ exact ⟨⟨n⟩, ZFSet.exact h⟩
82
+
83
+ theorem natSetCode_mem_omega (n : Nat) : natSetCode n ∈ ZFSet.omega.{u} :=
84
+ (mem_omega_iff_natSetCode _).2 ⟨n, rfl⟩
85
+
86
+ def zeroOrSuccessor (x : ZFSet.{u}) : Prop :=
87
+ x = ∅ ∨ ∃ y ∈ x, x = insert y y
88
+
89
+ def naturalSetProperty (x : ZFSet.{u}) : Prop :=
90
+ setTransitive x ∧ zeroOrSuccessor x ∧
91
+ ∀ y ∈ x, setTransitive y ∧ zeroOrSuccessor y
92
+
93
+ theorem naturalSetProperty_empty : naturalSetProperty (∅ : ZFSet.{u}) := by
94
+ refine ⟨?_, Or.inl rfl, ?_⟩
95
+ · intro y hy
96
+ exact False.elim (ZFSet.notMem_empty y hy)
97
+ · intro y hy
98
+ exact False.elim (ZFSet.notMem_empty y hy)
99
+
100
+ theorem naturalSetProperty_succ {x : ZFSet.{u}} (h : naturalSetProperty x) :
101
+ naturalSetProperty (insert x x) := by
102
+ refine ⟨?_, Or.inr ⟨x, ZFSet.mem_insert x x, rfl⟩, ?_⟩
103
+ · intro y hy z hz
104
+ rcases ZFSet.mem_insert_iff.1 hy with rfl | hy
105
+ · exact ZFSet.mem_insert_of_mem _ hz
106
+ · exact ZFSet.mem_insert_of_mem x (h.1 y hy z hz)
107
+ · intro y hy
108
+ rcases ZFSet.mem_insert_iff.1 hy with rfl | hy
109
+ · exact ⟨h.1, h.2.1⟩
110
+ · exact h.2.2 y hy
111
+
112
+ theorem naturalSetProperty_member {x y : ZFSet.{u}}
113
+ (h : naturalSetProperty x) (hy : y ∈ x) : naturalSetProperty y := by
114
+ have facts := h.2.2 y hy
115
+ exact ⟨facts.1, facts.2, fun z hz => h.2.2 z (h.1 y hy z hz)⟩
116
+
117
+ theorem naturalSetProperty_iff (x : ZFSet.{u}) :
118
+ naturalSetProperty x ↔ ∃ n, x = natSetCode n := by
119
+ constructor
120
+ · induction x using ZFSet.inductionOn with
121
+ | h x ih =>
122
+ intro hx
123
+ rcases hx.2.1 with empty | ⟨y, hy, succ⟩
124
+ · exact ⟨0, empty⟩
125
+ · obtain ⟨n, eq⟩ := ih y hy (naturalSetProperty_member hx hy)
126
+ exact ⟨n + 1, by rw [succ, eq]; rfl⟩
127
+ · rintro ⟨n, rfl⟩
128
+ induction n with
129
+ | zero => exact naturalSetProperty_empty
130
+ | succ n ih => exact naturalSetProperty_succ ih
131
+
132
+ theorem naturalSetProperty_iff_mem_omega (x : ZFSet.{u}) :
133
+ naturalSetProperty x ↔ x ∈ ZFSet.omega :=
134
+ (naturalSetProperty_iff x).trans (mem_omega_iff_natSetCode x).symm
135
+
136
+ instance omegaMembers_countable : Countable (SetRealization.SetMembers ZFSet.omega.{u}) := by
137
+ let f (n : Nat) := SetRealization.SetMembers.ofMem (natSetCode n) (natSetCode_mem_omega n)
138
+ have onto : Function.Surjective f := by
139
+ intro x
140
+ obtain ⟨n, eq⟩ := (mem_omega_iff_natSetCode _).1 (SetRealization.SetMembers.raw_mem x)
141
+ refine ⟨n, SetRealization.SetMembers.raw_injective _ ?_⟩
142
+ exact (SetRealization.SetMembers.raw_ofMem _ _).trans eq.symm
143
+ exact onto.countable
144
+
145
+ end PartitionPilot.Forcing
146
+
147
+ end
148
+
149
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/NaturalStepFormulas.lean CHANGED
@@ -1,259 +1,259 @@
1
- import OAI.SetTheory.PartitionPrinciple.Definability.TaggedSumPresentations
2
-
3
- namespace OAI
4
-
5
-
6
- namespace PartitionPilot.Forcing
7
-
8
- section
9
-
10
- universe u
11
-
12
- namespace SetFormula
13
-
14
- def functionGraphOnFormula {n} (a f : Fin n) : SetFormula n :=
15
- ex (BoundedFormula.functionFormula a.succ 0 f.succ).toFormula
16
-
17
- end SetFormula
18
-
19
- namespace BoundedFormula
20
-
21
- def graphRestrictionFormula {n} (p a b f : Fin n) : BoundedFormula n :=
22
- .conj (.allMem p (.conj (.mem 0 f.succ) (productElementFormula 0 a.succ b.succ)))
23
- (.allMem f (imp (productElementFormula 0 a.succ b.succ) (.mem 0 p.succ)))
24
-
25
- theorem truth_graphRestrictionFormula {n} (p a b f : Fin n) (env : Fin n → ZFSet.{u}) :
26
- Truth (graphRestrictionFormula p a b f) env ↔
27
- env p = ZFSet.sep (fun z => z ∈ ZFSet.prod (env a) (env b)) (env f) := by
28
- simp only [graphRestrictionFormula, Truth, truth_imp, truth_productElementFormula]
29
- change ((∀ z ∈ env p, z ∈ env f ∧ z ∈ ZFSet.prod (env a) (env b)) ∧
30
- (∀ z ∈ env f, z ∈ ZFSet.prod (env a) (env b) → z ∈ env p)) ↔ _
31
- constructor
32
- · rintro ⟨forward, backward⟩
33
- apply ZFSet.ext
34
- intro z
35
- rw [ZFSet.mem_sep]
36
- exact ⟨forward z, fun hz => backward z hz.1 hz.2⟩
37
- · intro eq
38
- rw [eq]
39
- exact ⟨fun z hz => ZFSet.mem_sep.1 hz, fun z hz bound => ZFSet.mem_sep.2 ⟨hz, bound⟩⟩
40
-
41
- end BoundedFormula
42
-
43
- namespace TransitiveGround
44
-
45
- open SetFormula
46
- variable (M : TransitiveGround.{u})
47
-
48
- theorem realize_functionGraphOnFormula
49
- (unions : Realize M.sets SetFormula.union Fin.elim0)
50
- {n} (a f : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) :
51
- Realize M.sets (functionGraphOnFormula a f) env ↔ FunctionGraphOn (env a) (env f) := by
52
- rw [functionGraphOnFormula, realize_ex]
53
- constructor
54
- · rintro ⟨B, hB, code⟩
55
- exact ⟨B, (BoundedFormula.truth_functionFormula a.succ 0 f.succ _).1
56
- ((BoundedFormula.realize_toFormula M _ _ (Fin.cases hB members)).1 code)⟩
57
- · intro code
58
- have range := M.union_mem unions (M.union_mem unions (members f))
59
- exact ⟨ZFSet.sUnion (ZFSet.sUnion (env f)), range,
60
- (BoundedFormula.realize_toFormula M _ _ (Fin.cases range members)).2
61
- ((BoundedFormula.truth_functionFormula a.succ 0 f.succ _).2 code.to_isFunc)⟩
62
-
63
- theorem realize_graphRestrictionFormula {n} (p a b f : Fin n)
64
- (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) :
65
- Realize M.sets (BoundedFormula.graphRestrictionFormula p a b f).toFormula env ↔
66
- env p = ZFSet.sep (fun z => z ∈ ZFSet.prod (env a) (env b)) (env f) :=
67
- (BoundedFormula.realize_toFormula M _ _ members).trans
68
- (BoundedFormula.truth_graphRestrictionFormula p a b f env)
69
-
70
- end TransitiveGround
71
-
72
- end
73
-
74
-
75
-
76
-
77
- open SetFormula
78
- universe u
79
-
80
- def groundRecursionStep (M : TransitiveGround.{u}) {k : Nat}
81
- (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u}) (a p y : ZFSet.{u}) : Prop :=
82
- p ∈ M.sets ∧ y ∈ M.sets ∧ Realize M.sets φ (extend a (extend p (extend y params)))
83
-
84
- namespace SetFormula
85
-
86
- def ordinalRecursionTraceFormula {k : Nat} (φ : SetFormula (k + 3)) : SetFormula (k + 2) :=
87
- ex <| .conj (BoundedFormula.functionFormula 1 0 2).toFormula <|
88
- .all <| imp (.mem 0 2) <| .all <| imp (.mem 0 2) <|
89
- imp (BoundedFormula.pairMembershipFormula 1 0 4).toFormula <|
90
- ex <| .conj (BoundedFormula.graphRestrictionFormula 0 2 3 5).toFormula <|
91
- reindex (extend 2 (extend 0 (extend 1
92
- (fun j => j.succ.succ.succ.succ.succ.succ)))) φ
93
-
94
- def ordinalSuccessorTraceFormula {k : Nat} (φ : SetFormula (k + 3)) : SetFormula (k + 2) :=
95
- ex (.conj (BoundedFormula.successorFormula 0 1).toFormula
96
- (reindex (extend 0 (extend 2 (fun j => j.succ.succ.succ))) (ordinalRecursionTraceFormula φ)))
97
-
98
- end SetFormula
99
-
100
- namespace TransitiveGround
101
-
102
- variable (M : TransitiveGround.{u})
103
-
104
- theorem realize_ordinalRecursionTraceFormula
105
- (unions : Realize M.sets SetFormula.union Fin.elim0)
106
- {k : Nat} (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u})
107
- (members : ∀ i, params i ∈ M.sets) {A f : ZFSet.{u}}
108
- (hA : A ∈ M.sets) (hf : f ∈ M.sets) :
109
- Realize M.sets (ordinalRecursionTraceFormula φ) (extend A (extend f params)) ↔
110
- OrdinalRecursionTrace (groundRecursionStep M φ params) A f := by
111
- rw [ordinalRecursionTraceFormula, realize_ex]
112
- constructor
113
- · rintro ⟨B, hB, function, steps⟩
114
- have mem3 : ∀ i, extend B (extend A (extend f params)) i ∈ M.sets :=
115
- Fin.cases hB (Fin.cases hA (Fin.cases hf members))
116
- have func : ZFSet.IsFunc A B f := (BoundedFormula.truth_functionFormula 1 0 2 _).1
117
- ((BoundedFormula.realize_toFormula M _ _ mem3).1 function)
118
- refine ⟨⟨B, func⟩, ?_⟩
119
- intro a ha y ay
120
- have haM := M.transitive hA ha
121
- have hyB := (ZFSet.pair_mem_prod.1 (func.1 ay)).2
122
- have hyM := M.transitive hB hyB
123
- have first := (realize_imp M.sets _ _ _).1 (steps a haM) ha
124
- have second := (realize_imp M.sets _ _ _).1 (first y hyM) hyB
125
- have mem5 : ∀ i, extend y (extend a (extend B (extend A (extend f params)))) i ∈ M.sets :=
126
- Fin.cases hyM (Fin.cases haM mem3)
127
- have pairCode := (BoundedFormula.realize_toFormula M _ _ mem5).2
128
- ((BoundedFormula.truth_pairMembershipFormula 1 0 4 _).2 ay)
129
- obtain ⟨p, hp, restricted, step⟩ := (realize_ex M.sets _ _).1
130
- ((realize_imp M.sets _ _ _).1 second pairCode)
131
- have eq := (M.realize_graphRestrictionFormula 0 2 3 5 _ (Fin.cases hp mem5)).1 restricted
132
- have same : p = graphRestriction a f := eq.trans (graphRestriction_eq_sep func).symm
133
- rw [realize_reindex, map_extend, map_extend, map_extend] at step
134
- change Realize M.sets φ (extend a (extend p (extend y params))) at step
135
- rw [same] at hp step
136
- exact ⟨hp, hyM, step⟩
137
- · intro trace
138
- let B := ZFSet.sUnion (ZFSet.sUnion f)
139
- have hB : B ∈ M.sets := M.union_mem unions (M.union_mem unions hf)
140
- have func : ZFSet.IsFunc A B f := trace.1.to_isFunc
141
- have mem3 : ∀ i, extend B (extend A (extend f params)) i ∈ M.sets :=
142
- Fin.cases hB (Fin.cases hA (Fin.cases hf members))
143
- refine ⟨B, hB, (BoundedFormula.realize_toFormula M _ _ mem3).2
144
- ((BoundedFormula.truth_functionFormula 1 0 2 _).2 func), ?_⟩
145
- intro a haM
146
- apply (realize_imp M.sets _ _ _).2
147
- intro ha y hyM
148
- apply (realize_imp M.sets _ _ _).2
149
- intro _
150
- apply (realize_imp M.sets _ _ _).2
151
- intro pairCode
152
- have mem5 : ∀ i, extend y (extend a (extend B (extend A (extend f params)))) i ∈ M.sets :=
153
- Fin.cases hyM (Fin.cases haM mem3)
154
- have ay := (BoundedFormula.truth_pairMembershipFormula 1 0 4 _).1
155
- ((BoundedFormula.realize_toFormula M _ _ mem5).1 pairCode)
156
- obtain ⟨hp, _, step⟩ := trace.2 a ha y ay
157
- apply (realize_ex M.sets _ _).2
158
- refine ⟨graphRestriction a f, hp,
159
- (M.realize_graphRestrictionFormula 0 2 3 5 _ (Fin.cases hp mem5)).2
160
- (graphRestriction_eq_sep func), ?_⟩
161
- rw [realize_reindex, map_extend, map_extend, map_extend]
162
- exact step
163
-
164
- theorem realize_ordinalSuccessorTraceFormula
165
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
166
- (unions : Realize M.sets SetFormula.union Fin.elim0)
167
- {k : Nat} (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u})
168
- (members : ∀ i, params i ∈ M.sets) {a f : ZFSet.{u}}
169
- (ha : a ∈ M.sets) (hf : f ∈ M.sets) :
170
- Realize M.sets (ordinalSuccessorTraceFormula φ) (extend a (extend f params)) ↔
171
- OrdinalRecursionTrace (groundRecursionStep M φ params) (insert a a) f := by
172
- rw [ordinalSuccessorTraceFormula, realize_ex]
173
- constructor
174
- · rintro ⟨A, hA, successor, trace⟩
175
- have eq := (BoundedFormula.truth_successorFormula 0 1 _).1
176
- ((BoundedFormula.realize_toFormula M _ _
177
- (Fin.cases hA (Fin.cases ha (Fin.cases hf members)))).1 successor)
178
- rw [realize_reindex, map_extend, map_extend] at trace
179
- change Realize M.sets (ordinalRecursionTraceFormula φ) (extend A (extend f params)) at trace
180
- have code := (M.realize_ordinalRecursionTraceFormula unions φ params members hA hf).1 trace
181
- exact eq ▸ code
182
- · intro trace
183
- have hA := M.insert_mem pairing unions ha ha
184
- refine ⟨insert a a, hA, (BoundedFormula.realize_toFormula M _ _
185
- (Fin.cases hA (Fin.cases ha (Fin.cases hf members)))).2
186
- ((BoundedFormula.truth_successorFormula 0 1 _).2 rfl), ?_⟩
187
- rw [realize_reindex, map_extend, map_extend]
188
- exact (M.realize_ordinalRecursionTraceFormula unions φ params members hA hf).2 trace
189
-
190
- end TransitiveGround
191
-
192
-
193
-
194
-
195
-
196
- namespace SetFormula
197
-
198
- def naturalStepFormula {k : Nat} (successor : SetFormula (k + 2)) : SetFormula (k + 4) :=
199
- disj (.conj (BoundedFormula.emptyFormula 0).toFormula (.equal 2 3))
200
- (ex (ex (.conj (BoundedFormula.successorFormula 2 1).toFormula
201
- (.conj (BoundedFormula.pairMembershipFormula 1 0 3).toFormula
202
- (reindex (extend 0 (extend 4 (fun j => j.succ.succ.succ.succ.succ.succ))) successor)))))
203
-
204
- end SetFormula
205
-
206
- namespace TransitiveGround
207
- variable (M : TransitiveGround.{u})
208
-
209
- theorem realize_naturalStepFormula {k : Nat} (φ : SetFormula (k + 2))
210
- (params : Fin k → ZFSet.{u}) (members : ∀ i, params i ∈ M.sets)
211
- {a p y base : ZFSet.{u}} (ha : a ∈ M.sets) (hp : p ∈ M.sets)
212
- (hy : y ∈ M.sets) (hb : base ∈ M.sets) :
213
- Realize M.sets (naturalStepFormula φ) (extend a (extend p (extend y (extend base params)))) ↔
214
- (a = ∅ ∧ y = base) ∨ ∃ m ∈ M.sets, ∃ x ∈ M.sets,
215
- a = insert m m ∧ ZFSet.pair m x ∈ p ∧
216
- Realize M.sets φ (extend x (extend y params)) := by
217
- have mem4 : ∀ i, extend a (extend p (extend y (extend base params))) i ∈ M.sets :=
218
- Fin.cases ha (Fin.cases hp (Fin.cases hy (Fin.cases hb members)))
219
- rw [naturalStepFormula, realize_disj]
220
- apply or_congr
221
- · change (Realize M.sets (BoundedFormula.emptyFormula 0).toFormula _ ∧ y = base) ↔ _
222
- exact and_congr ((BoundedFormula.realize_toFormula M _ _ mem4).trans
223
- (BoundedFormula.truth_emptyFormula _ _)) Iff.rfl
224
- · rw [realize_ex]
225
- apply exists_congr
226
- intro m
227
- apply and_congr_right
228
- intro hm
229
- rw [realize_ex]
230
- apply exists_congr
231
- intro x
232
- apply and_congr_right
233
- intro hx
234
- have mem6 : ∀ i, extend x (extend m (extend a (extend p (extend y (extend base params))))) i ∈ M.sets :=
235
- Fin.cases hx (Fin.cases hm mem4)
236
- change (Realize M.sets (BoundedFormula.successorFormula 2 1).toFormula _ ∧
237
- Realize M.sets (BoundedFormula.pairMembershipFormula 1 0 3).toFormula _ ∧ _) ↔ _
238
- rw [BoundedFormula.realize_toFormula M _ _ mem6, BoundedFormula.truth_successorFormula,
239
- BoundedFormula.realize_toFormula M _ _ mem6, BoundedFormula.truth_pairMembershipFormula,
240
- realize_reindex, map_extend, map_extend]
241
- rfl
242
-
243
- end TransitiveGround
244
-
245
- theorem natSetCode_succ_eq_insert_iff (n : Nat) (x : ZFSet.{u}) :
246
- natSetCode (n + 1) = insert x x ↔ x = natSetCode n := by
247
- constructor
248
- · intro equal
249
- have member : x ∈ natSetCode (n + 1) := equal.symm ▸ ZFSet.mem_insert x x
250
- obtain ⟨j, _, rfl⟩ := (mem_natSetCode x (n + 1)).1 member
251
- have codes : natSetCode (n + 1) = natSetCode (j + 1) := equal
252
- exact congrArg natSetCode (Nat.add_right_cancel (natSetCode_injective codes)).symm
253
- · rintro rfl
254
- rfl
255
-
256
-
257
- end PartitionPilot.Forcing
258
-
259
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Definability.TaggedSumPresentations
2
+
3
+ namespace OAI
4
+
5
+
6
+ namespace PartitionPilot.Forcing
7
+
8
+ section
9
+
10
+ universe u
11
+
12
+ namespace SetFormula
13
+
14
+ def functionGraphOnFormula {n} (a f : Fin n) : SetFormula n :=
15
+ ex (BoundedFormula.functionFormula a.succ 0 f.succ).toFormula
16
+
17
+ end SetFormula
18
+
19
+ namespace BoundedFormula
20
+
21
+ def graphRestrictionFormula {n} (p a b f : Fin n) : BoundedFormula n :=
22
+ .conj (.allMem p (.conj (.mem 0 f.succ) (productElementFormula 0 a.succ b.succ)))
23
+ (.allMem f (imp (productElementFormula 0 a.succ b.succ) (.mem 0 p.succ)))
24
+
25
+ theorem truth_graphRestrictionFormula {n} (p a b f : Fin n) (env : Fin n → ZFSet.{u}) :
26
+ Truth (graphRestrictionFormula p a b f) env ↔
27
+ env p = ZFSet.sep (fun z => z ∈ ZFSet.prod (env a) (env b)) (env f) := by
28
+ simp only [graphRestrictionFormula, Truth, truth_imp, truth_productElementFormula]
29
+ change ((∀ z ∈ env p, z ∈ env f ∧ z ∈ ZFSet.prod (env a) (env b)) ∧
30
+ (∀ z ∈ env f, z ∈ ZFSet.prod (env a) (env b) → z ∈ env p)) ↔ _
31
+ constructor
32
+ · rintro ⟨forward, backward⟩
33
+ apply ZFSet.ext
34
+ intro z
35
+ rw [ZFSet.mem_sep]
36
+ exact ⟨forward z, fun hz => backward z hz.1 hz.2⟩
37
+ · intro eq
38
+ rw [eq]
39
+ exact ⟨fun z hz => ZFSet.mem_sep.1 hz, fun z hz bound => ZFSet.mem_sep.2 ⟨hz, bound⟩⟩
40
+
41
+ end BoundedFormula
42
+
43
+ namespace TransitiveGround
44
+
45
+ open SetFormula
46
+ variable (M : TransitiveGround.{u})
47
+
48
+ theorem realize_functionGraphOnFormula
49
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
50
+ {n} (a f : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) :
51
+ Realize M.sets (functionGraphOnFormula a f) env ↔ FunctionGraphOn (env a) (env f) := by
52
+ rw [functionGraphOnFormula, realize_ex]
53
+ constructor
54
+ · rintro ⟨B, hB, code⟩
55
+ exact ⟨B, (BoundedFormula.truth_functionFormula a.succ 0 f.succ _).1
56
+ ((BoundedFormula.realize_toFormula M _ _ (Fin.cases hB members)).1 code)⟩
57
+ · intro code
58
+ have range := M.union_mem unions (M.union_mem unions (members f))
59
+ exact ⟨ZFSet.sUnion (ZFSet.sUnion (env f)), range,
60
+ (BoundedFormula.realize_toFormula M _ _ (Fin.cases range members)).2
61
+ ((BoundedFormula.truth_functionFormula a.succ 0 f.succ _).2 code.to_isFunc)⟩
62
+
63
+ theorem realize_graphRestrictionFormula {n} (p a b f : Fin n)
64
+ (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) :
65
+ Realize M.sets (BoundedFormula.graphRestrictionFormula p a b f).toFormula env ↔
66
+ env p = ZFSet.sep (fun z => z ∈ ZFSet.prod (env a) (env b)) (env f) :=
67
+ (BoundedFormula.realize_toFormula M _ _ members).trans
68
+ (BoundedFormula.truth_graphRestrictionFormula p a b f env)
69
+
70
+ end TransitiveGround
71
+
72
+ end
73
+
74
+
75
+
76
+
77
+ open SetFormula
78
+ universe u
79
+
80
+ def groundRecursionStep (M : TransitiveGround.{u}) {k : Nat}
81
+ (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u}) (a p y : ZFSet.{u}) : Prop :=
82
+ p ∈ M.sets ∧ y ∈ M.sets ∧ Realize M.sets φ (extend a (extend p (extend y params)))
83
+
84
+ namespace SetFormula
85
+
86
+ def ordinalRecursionTraceFormula {k : Nat} (φ : SetFormula (k + 3)) : SetFormula (k + 2) :=
87
+ ex <| .conj (BoundedFormula.functionFormula 1 0 2).toFormula <|
88
+ .all <| imp (.mem 0 2) <| .all <| imp (.mem 0 2) <|
89
+ imp (BoundedFormula.pairMembershipFormula 1 0 4).toFormula <|
90
+ ex <| .conj (BoundedFormula.graphRestrictionFormula 0 2 3 5).toFormula <|
91
+ reindex (extend 2 (extend 0 (extend 1
92
+ (fun j => j.succ.succ.succ.succ.succ.succ)))) φ
93
+
94
+ def ordinalSuccessorTraceFormula {k : Nat} (φ : SetFormula (k + 3)) : SetFormula (k + 2) :=
95
+ ex (.conj (BoundedFormula.successorFormula 0 1).toFormula
96
+ (reindex (extend 0 (extend 2 (fun j => j.succ.succ.succ))) (ordinalRecursionTraceFormula φ)))
97
+
98
+ end SetFormula
99
+
100
+ namespace TransitiveGround
101
+
102
+ variable (M : TransitiveGround.{u})
103
+
104
+ theorem realize_ordinalRecursionTraceFormula
105
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
106
+ {k : Nat} (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u})
107
+ (members : ∀ i, params i ∈ M.sets) {A f : ZFSet.{u}}
108
+ (hA : A ∈ M.sets) (hf : f ∈ M.sets) :
109
+ Realize M.sets (ordinalRecursionTraceFormula φ) (extend A (extend f params)) ↔
110
+ OrdinalRecursionTrace (groundRecursionStep M φ params) A f := by
111
+ rw [ordinalRecursionTraceFormula, realize_ex]
112
+ constructor
113
+ · rintro ⟨B, hB, function, steps⟩
114
+ have mem3 : ∀ i, extend B (extend A (extend f params)) i ∈ M.sets :=
115
+ Fin.cases hB (Fin.cases hA (Fin.cases hf members))
116
+ have func : ZFSet.IsFunc A B f := (BoundedFormula.truth_functionFormula 1 0 2 _).1
117
+ ((BoundedFormula.realize_toFormula M _ _ mem3).1 function)
118
+ refine ⟨⟨B, func⟩, ?_⟩
119
+ intro a ha y ay
120
+ have haM := M.transitive hA ha
121
+ have hyB := (ZFSet.pair_mem_prod.1 (func.1 ay)).2
122
+ have hyM := M.transitive hB hyB
123
+ have first := (realize_imp M.sets _ _ _).1 (steps a haM) ha
124
+ have second := (realize_imp M.sets _ _ _).1 (first y hyM) hyB
125
+ have mem5 : ∀ i, extend y (extend a (extend B (extend A (extend f params)))) i ∈ M.sets :=
126
+ Fin.cases hyM (Fin.cases haM mem3)
127
+ have pairCode := (BoundedFormula.realize_toFormula M _ _ mem5).2
128
+ ((BoundedFormula.truth_pairMembershipFormula 1 0 4 _).2 ay)
129
+ obtain ⟨p, hp, restricted, step⟩ := (realize_ex M.sets _ _).1
130
+ ((realize_imp M.sets _ _ _).1 second pairCode)
131
+ have eq := (M.realize_graphRestrictionFormula 0 2 3 5 _ (Fin.cases hp mem5)).1 restricted
132
+ have same : p = graphRestriction a f := eq.trans (graphRestriction_eq_sep func).symm
133
+ rw [realize_reindex, map_extend, map_extend, map_extend] at step
134
+ change Realize M.sets φ (extend a (extend p (extend y params))) at step
135
+ rw [same] at hp step
136
+ exact ⟨hp, hyM, step⟩
137
+ · intro trace
138
+ let B := ZFSet.sUnion (ZFSet.sUnion f)
139
+ have hB : B ∈ M.sets := M.union_mem unions (M.union_mem unions hf)
140
+ have func : ZFSet.IsFunc A B f := trace.1.to_isFunc
141
+ have mem3 : ∀ i, extend B (extend A (extend f params)) i ∈ M.sets :=
142
+ Fin.cases hB (Fin.cases hA (Fin.cases hf members))
143
+ refine ⟨B, hB, (BoundedFormula.realize_toFormula M _ _ mem3).2
144
+ ((BoundedFormula.truth_functionFormula 1 0 2 _).2 func), ?_⟩
145
+ intro a haM
146
+ apply (realize_imp M.sets _ _ _).2
147
+ intro ha y hyM
148
+ apply (realize_imp M.sets _ _ _).2
149
+ intro _
150
+ apply (realize_imp M.sets _ _ _).2
151
+ intro pairCode
152
+ have mem5 : ∀ i, extend y (extend a (extend B (extend A (extend f params)))) i ∈ M.sets :=
153
+ Fin.cases hyM (Fin.cases haM mem3)
154
+ have ay := (BoundedFormula.truth_pairMembershipFormula 1 0 4 _).1
155
+ ((BoundedFormula.realize_toFormula M _ _ mem5).1 pairCode)
156
+ obtain ⟨hp, _, step⟩ := trace.2 a ha y ay
157
+ apply (realize_ex M.sets _ _).2
158
+ refine ⟨graphRestriction a f, hp,
159
+ (M.realize_graphRestrictionFormula 0 2 3 5 _ (Fin.cases hp mem5)).2
160
+ (graphRestriction_eq_sep func), ?_⟩
161
+ rw [realize_reindex, map_extend, map_extend, map_extend]
162
+ exact step
163
+
164
+ theorem realize_ordinalSuccessorTraceFormula
165
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
166
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
167
+ {k : Nat} (φ : SetFormula (k + 3)) (params : Fin k → ZFSet.{u})
168
+ (members : ∀ i, params i ∈ M.sets) {a f : ZFSet.{u}}
169
+ (ha : a ∈ M.sets) (hf : f ∈ M.sets) :
170
+ Realize M.sets (ordinalSuccessorTraceFormula φ) (extend a (extend f params)) ↔
171
+ OrdinalRecursionTrace (groundRecursionStep M φ params) (insert a a) f := by
172
+ rw [ordinalSuccessorTraceFormula, realize_ex]
173
+ constructor
174
+ · rintro ⟨A, hA, successor, trace⟩
175
+ have eq := (BoundedFormula.truth_successorFormula 0 1 _).1
176
+ ((BoundedFormula.realize_toFormula M _ _
177
+ (Fin.cases hA (Fin.cases ha (Fin.cases hf members)))).1 successor)
178
+ rw [realize_reindex, map_extend, map_extend] at trace
179
+ change Realize M.sets (ordinalRecursionTraceFormula φ) (extend A (extend f params)) at trace
180
+ have code := (M.realize_ordinalRecursionTraceFormula unions φ params members hA hf).1 trace
181
+ exact eq ▸ code
182
+ · intro trace
183
+ have hA := M.insert_mem pairing unions ha ha
184
+ refine ⟨insert a a, hA, (BoundedFormula.realize_toFormula M _ _
185
+ (Fin.cases hA (Fin.cases ha (Fin.cases hf members)))).2
186
+ ((BoundedFormula.truth_successorFormula 0 1 _).2 rfl), ?_⟩
187
+ rw [realize_reindex, map_extend, map_extend]
188
+ exact (M.realize_ordinalRecursionTraceFormula unions φ params members hA hf).2 trace
189
+
190
+ end TransitiveGround
191
+
192
+
193
+
194
+
195
+
196
+ namespace SetFormula
197
+
198
+ def naturalStepFormula {k : Nat} (successor : SetFormula (k + 2)) : SetFormula (k + 4) :=
199
+ disj (.conj (BoundedFormula.emptyFormula 0).toFormula (.equal 2 3))
200
+ (ex (ex (.conj (BoundedFormula.successorFormula 2 1).toFormula
201
+ (.conj (BoundedFormula.pairMembershipFormula 1 0 3).toFormula
202
+ (reindex (extend 0 (extend 4 (fun j => j.succ.succ.succ.succ.succ.succ))) successor)))))
203
+
204
+ end SetFormula
205
+
206
+ namespace TransitiveGround
207
+ variable (M : TransitiveGround.{u})
208
+
209
+ theorem realize_naturalStepFormula {k : Nat} (φ : SetFormula (k + 2))
210
+ (params : Fin k → ZFSet.{u}) (members : ∀ i, params i ∈ M.sets)
211
+ {a p y base : ZFSet.{u}} (ha : a ∈ M.sets) (hp : p ∈ M.sets)
212
+ (hy : y ∈ M.sets) (hb : base ∈ M.sets) :
213
+ Realize M.sets (naturalStepFormula φ) (extend a (extend p (extend y (extend base params)))) ↔
214
+ (a = ∅ ∧ y = base) ∨ ∃ m ∈ M.sets, ∃ x ∈ M.sets,
215
+ a = insert m m ∧ ZFSet.pair m x ∈ p ∧
216
+ Realize M.sets φ (extend x (extend y params)) := by
217
+ have mem4 : ∀ i, extend a (extend p (extend y (extend base params))) i ∈ M.sets :=
218
+ Fin.cases ha (Fin.cases hp (Fin.cases hy (Fin.cases hb members)))
219
+ rw [naturalStepFormula, realize_disj]
220
+ apply or_congr
221
+ · change (Realize M.sets (BoundedFormula.emptyFormula 0).toFormula _ ∧ y = base) ↔ _
222
+ exact and_congr ((BoundedFormula.realize_toFormula M _ _ mem4).trans
223
+ (BoundedFormula.truth_emptyFormula _ _)) Iff.rfl
224
+ · rw [realize_ex]
225
+ apply exists_congr
226
+ intro m
227
+ apply and_congr_right
228
+ intro hm
229
+ rw [realize_ex]
230
+ apply exists_congr
231
+ intro x
232
+ apply and_congr_right
233
+ intro hx
234
+ have mem6 : ∀ i, extend x (extend m (extend a (extend p (extend y (extend base params))))) i ∈ M.sets :=
235
+ Fin.cases hx (Fin.cases hm mem4)
236
+ change (Realize M.sets (BoundedFormula.successorFormula 2 1).toFormula _ ∧
237
+ Realize M.sets (BoundedFormula.pairMembershipFormula 1 0 3).toFormula _ ∧ _) ↔ _
238
+ rw [BoundedFormula.realize_toFormula M _ _ mem6, BoundedFormula.truth_successorFormula,
239
+ BoundedFormula.realize_toFormula M _ _ mem6, BoundedFormula.truth_pairMembershipFormula,
240
+ realize_reindex, map_extend, map_extend]
241
+ rfl
242
+
243
+ end TransitiveGround
244
+
245
+ theorem natSetCode_succ_eq_insert_iff (n : Nat) (x : ZFSet.{u}) :
246
+ natSetCode (n + 1) = insert x x ↔ x = natSetCode n := by
247
+ constructor
248
+ · intro equal
249
+ have member : x ∈ natSetCode (n + 1) := equal.symm ▸ ZFSet.mem_insert x x
250
+ obtain ⟨j, _, rfl⟩ := (mem_natSetCode x (n + 1)).1 member
251
+ have codes : natSetCode (n + 1) = natSetCode (j + 1) := equal
252
+ exact congrArg natSetCode (Nat.add_right_cancel (natSetCode_injective codes)).symm
253
+ · rintro rfl
254
+ rfl
255
+
256
+
257
+ end PartitionPilot.Forcing
258
+
259
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/NonemptyTupleFields.lean CHANGED
@@ -1,482 +1,482 @@
1
- import OAI.SetTheory.PartitionPrinciple.Models.GroundInjectionRestrictions
2
-
3
- namespace OAI
4
-
5
-
6
- namespace PartitionPilot.Forcing
7
-
8
- universe u
9
-
10
- noncomputable def nonemptyTupleCode : (k : Nat) → (Fin (k + 1) → ZFSet.{u}) → ZFSet.{u}
11
- | 0, fields => fields 0
12
- | k + 1, fields => ZFSet.pair (fields 0) (nonemptyTupleCode k (fun i => fields i.succ))
13
-
14
- theorem nonemptyTupleCode_injective (k : Nat) : Function.Injective (nonemptyTupleCode.{u} k) := by
15
- induction k with
16
- | zero =>
17
- intro fields fields' equal
18
- funext i
19
- exact Fin.cases equal (fun j => Fin.elim0 j) i
20
- | succ k ih =>
21
- intro fields fields' equal
22
- obtain ⟨head, tail⟩ := ZFSet.pair_inj.1 equal
23
- have same := ih tail
24
- funext i
25
- exact Fin.cases head (fun j => congrFun same j) i
26
-
27
- namespace BoundedFormula
28
-
29
- open SetFormula
30
-
31
- def nonemptyTupleFormula : (k : Nat) → {n : Nat} →
32
- Fin n → (Fin (k + 1) → Fin n) → BoundedFormula n
33
- | 0, _, z, fields => .equal z (fields 0)
34
- | k + 1, _, z, fields => exMem z (exMem 0
35
- (.conj (orderedPairFormula z.succ.succ (fields 0).succ.succ 0)
36
- (nonemptyTupleFormula k 0 (fun i => (fields i.succ).succ.succ))))
37
-
38
- theorem truth_nonemptyTupleFormula (k : Nat) {n : Nat} (z : Fin n)
39
- (fields : Fin (k + 1) → Fin n) (env : Fin n → ZFSet.{u}) :
40
- Truth (nonemptyTupleFormula k z fields) env ↔
41
- env z = nonemptyTupleCode k (fun i => env (fields i)) := by
42
- induction k generalizing n with
43
- | zero => rfl
44
- | succ k ih =>
45
- simp only [nonemptyTupleFormula, truth_exMem, Truth, truth_orderedPairFormula, ih]
46
- change (∃ a ∈ env z, ∃ b ∈ a, env z = ZFSet.pair (env (fields 0)) b ∧
47
- b = nonemptyTupleCode k (fun i => env (fields i.succ))) ↔ _
48
- constructor
49
- · rintro ⟨_, _, b, _, outer, tail⟩
50
- rw [outer, tail]
51
- rfl
52
- · intro equal
53
- let tail := nonemptyTupleCode k (fun i => env (fields i.succ))
54
- have outer : env z = ZFSet.pair (env (fields 0)) tail := equal
55
- refine ⟨{env (fields 0), tail}, ?_, tail, ZFSet.mem_pair.2 (Or.inr rfl), outer, rfl⟩
56
- rw [outer]
57
- exact ZFSet.mem_pair.2 (Or.inr rfl)
58
-
59
- end BoundedFormula
60
-
61
- namespace TransitiveGround
62
-
63
- open SetFormula
64
- variable (M : TransitiveGround.{u})
65
-
66
- theorem nonemptyTupleCode_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
67
- (k : Nat) (fields : Fin (k + 1) → ZFSet.{u}) (ground : ∀ i, fields i ∈ M.sets) :
68
- nonemptyTupleCode k fields ∈ M.sets := by
69
- induction k with
70
- | zero => exact ground 0
71
- | succ k ih => exact M.orderedPair_mem pairing (ground 0) (ih _ (fun i => ground i.succ))
72
-
73
- theorem nonemptyTupleCode_field_mem (k : Nat) (fields : Fin (k + 1) → ZFSet.{u})
74
- (ground : nonemptyTupleCode k fields ∈ M.sets) : ∀ i, fields i ∈ M.sets := by
75
- induction k with
76
- | zero => exact Fin.cases ground (fun i => Fin.elim0 i)
77
- | succ k ih =>
78
- have pairGround : ZFSet.pair (fields 0) (nonemptyTupleCode k (fun i => fields i.succ)) ∈ M.sets := ground
79
- have both : ({fields 0, nonemptyTupleCode k (fun i => fields i.succ)} : ZFSet.{u}) ∈ M.sets :=
80
- M.transitive pairGround (ZFSet.mem_pair.2 (Or.inr rfl))
81
- have head := M.transitive both (ZFSet.mem_pair.2 (Or.inl rfl))
82
- have tail := M.transitive both (ZFSet.mem_pair.2 (Or.inr rfl))
83
- exact Fin.cases head (ih _ tail)
84
-
85
- end TransitiveGround
86
-
87
- end PartitionPilot.Forcing
88
-
89
-
90
-
91
- namespace PartitionPilot.Forcing.BoundedFormula
92
- open SetFormula
93
- universe u
94
-
95
- def reindex : {n m : Nat} → (Fin n → Fin m) → BoundedFormula n → BoundedFormula m
96
- | _, _, f, .equal i j => .equal (f i) (f j)
97
- | _, _, f, .mem i j => .mem (f i) (f j)
98
- | _, _, f, .neg φ => .neg (reindex f φ)
99
- | _, _, f, .conj φ ψ => .conj (reindex f φ) (reindex f ψ)
100
- | _, _, f, .allMem b φ => .allMem (f b) (reindex (liftIndex f) φ)
101
-
102
- theorem truth_reindex {n m} (f : Fin n → Fin m) (φ : BoundedFormula n)
103
- (env : Fin m → ZFSet.{u}) :
104
- Truth (reindex f φ) env ↔ Truth φ (fun i => env (f i)) := by
105
- induction φ generalizing m with
106
- | equal i j => rfl
107
- | mem i j => rfl
108
- | neg φ ih => exact not_congr (ih f env)
109
- | conj φ ψ ihφ ihψ => exact and_congr (ihφ f env) (ihψ f env)
110
- | allMem b φ ih =>
111
- change (∀ x ∈ env (f b), Truth (reindex (liftIndex f) φ) (extend x env)) ↔ _
112
- apply forall_congr'
113
- intro x
114
- apply forall_congr'
115
- intro _
116
- rw [ih, extend_liftIndex]
117
-
118
- def exPairFields {n} (z : Fin n) (body : BoundedFormula (n + 2)) : BoundedFormula n :=
119
- exMem z (exMem 0 (exMem z.succ.succ (exMem 0
120
- (.conj (orderedPairFormula z.succ.succ.succ.succ 2 0)
121
- (reindex (Fin.cases 0 (Fin.cases 2 (fun i => i.succ.succ.succ.succ))) body)))))
122
-
123
- theorem truth_exPairFields {n} (z : Fin n) (body : BoundedFormula (n + 2))
124
- (env : Fin n → ZFSet.{u}) :
125
- Truth (exPairFields z body) env ↔
126
- ∃ x y, env z = ZFSet.pair x y ∧ Truth body (extend y (extend x env)) := by
127
- simp only [exPairFields, truth_exMem, Truth, truth_orderedPairFormula, truth_reindex]
128
- have rearrange (a x b y : ZFSet.{u}) :
129
- (fun i => extend y (extend b (extend x (extend a env)))
130
- (Fin.cases 0 (Fin.cases 2 (fun j => j.succ.succ.succ.succ)) i)) =
131
- extend y (extend x env) := by
132
- funext i
133
- refine Fin.cases ?_ (fun j => Fin.cases ?_ (fun k => ?_) j) i <;> rfl
134
- simp only [rearrange]
135
- change (∃ a ∈ env z, ∃ x ∈ a, ∃ b ∈ env z, ∃ y ∈ b,
136
- env z = ZFSet.pair x y ∧ Truth body (extend y (extend x env))) ↔ _
137
- constructor
138
- · rintro ⟨a, _, x, _, b, _, y, _, equal, holds⟩
139
- exact ⟨x, y, equal, holds⟩
140
- · rintro ⟨x, y, equal, holds⟩
141
- have both : ({x, y} : ZFSet.{u}) ∈ env z := by
142
- rw [equal]
143
- exact ZFSet.mem_pair.2 (Or.inr rfl)
144
- exact ⟨{x,y}, both, x, ZFSet.mem_pair.2 (Or.inl rfl),
145
- {x,y}, both, y, ZFSet.mem_pair.2 (Or.inr rfl), equal, holds⟩
146
-
147
- def tupleShapeFormula : (k : Nat) → {n : Nat} → Fin n → BoundedFormula n
148
- | 0, _, z => .equal z z
149
- | k + 1, _, z => exPairFields z (tupleShapeFormula k 0)
150
-
151
- theorem truth_tupleShapeFormula (k : Nat) {n} (z : Fin n) (env : Fin n → ZFSet.{u}) :
152
- Truth (tupleShapeFormula k z) env ↔ ∃ fields, env z = nonemptyTupleCode k fields := by
153
- induction k generalizing n with
154
- | zero =>
155
- change env z = env z ↔ ∃ fields : Fin 1 → ZFSet.{u}, env z = fields 0
156
- exact ⟨fun _ => ⟨fun _ => env z, rfl⟩, fun _ => rfl⟩
157
- | succ k ih =>
158
- rw [tupleShapeFormula, truth_exPairFields]
159
- constructor
160
- · rintro ⟨x, y, equal, shape⟩
161
- obtain ⟨fields, tail⟩ := (ih 0 (extend y (extend x env))).1 shape
162
- refine ⟨Fin.cases x fields, ?_⟩
163
- change env z = ZFSet.pair x (nonemptyTupleCode k fields)
164
- exact equal.trans (congrArg (ZFSet.pair x) tail)
165
- · rintro ⟨fields, equal⟩
166
- exact ⟨fields 0, nonemptyTupleCode k (fun i => fields i.succ), equal,
167
- (ih 0 _).2 ⟨fun i => fields i.succ, rfl⟩⟩
168
-
169
- end PartitionPilot.Forcing.BoundedFormula
170
-
171
-
172
-
173
- namespace PartitionPilot.Forcing
174
- universe u
175
-
176
- noncomputable def refinementIndexCode (level C E U Rf Rc : ZFSet.{u}) : ZFSet.{u} :=
177
- nonemptyTupleCode 5 ![level, C, E, U, Rf, Rc]
178
-
179
- theorem refinementIndexCode_eq_iff (level C E U Rf Rc level' C' E' U' Rf' Rc' : ZFSet.{u}) :
180
- refinementIndexCode level C E U Rf Rc = refinementIndexCode level' C' E' U' Rf' Rc' ↔
181
- level = level' ∧ C = C' ∧ E = E' ∧ U = U' ∧ Rf = Rf' ∧ Rc = Rc' := by
182
- simp only [refinementIndexCode, nonemptyTupleCode, Matrix.cons_val_zero,
183
- Matrix.cons_val_succ, ZFSet.pair_inj]
184
-
185
- noncomputable def refinementIndexBound (L P V W : ZFSet.{u}) : ZFSet.{u} :=
186
- ZFSet.prod L (ZFSet.prod P (ZFSet.prod P (ZFSet.prod V (ZFSet.prod W W))))
187
-
188
- theorem mem_refinementIndexBound (L P V W z : ZFSet.{u}) :
189
- z ∈ refinementIndexBound L P V W ↔
190
- ∃ level ∈ L, ∃ C ∈ P, ∃ E ∈ P, ∃ U ∈ V, ∃ Rf ∈ W, ∃ Rc ∈ W,
191
- z = refinementIndexCode level C E U Rf Rc := by
192
- simp only [refinementIndexBound, ZFSet.mem_prod]
193
- constructor
194
- · rintro ⟨level, hlevel, rest, ⟨C, hC, rest', ⟨E, hE, rest'', ⟨U, hU,
195
- rest''', ⟨Rf, hRf, Rc, hRc, rfl⟩, rfl⟩, rfl⟩, rfl⟩, rfl⟩
196
- exact ⟨level, hlevel, C, hC, E, hE, U, hU, Rf, hRf, Rc, hRc, rfl⟩
197
- · rintro ⟨level, hlevel, C, hC, E, hE, U, hU, Rf, hRf, Rc, hRc, rfl⟩
198
- exact ⟨level, hlevel, _, ⟨C, hC, _, ⟨E, hE, _, ⟨U, hU, _,
199
- ⟨Rf, hRf, Rc, hRc, rfl⟩, rfl⟩, rfl⟩, rfl⟩, rfl⟩
200
-
201
- theorem refinementIndexCode_mem_bound (L P V W level C E U Rf Rc : ZFSet.{u}) :
202
- refinementIndexCode level C E U Rf Rc ∈ refinementIndexBound L P V W ↔
203
- level ∈ L ∧ C ∈ P ∧ E ∈ P ∧ U ∈ V ∧ Rf ∈ W ∧ Rc ∈ W := by
204
- rw [mem_refinementIndexBound]
205
- constructor
206
- · rintro ⟨l, hl, c, hc, e, he, a, ha, r, hr, t, ht, equal⟩
207
- obtain ⟨rfl, rfl, rfl, rfl, rfl, rfl⟩ := (refinementIndexCode_eq_iff _ _ _ _ _ _ _ _ _ _ _ _).1 equal
208
- exact ⟨hl, hc, he, ha, hr, ht⟩
209
- · rintro ⟨hl, hc, he, hu, hf, hr⟩
210
- exact ⟨level, hl, C, hc, E, he, U, hu, Rf, hf, Rc, hr, rfl⟩
211
-
212
- namespace BoundedFormula
213
-
214
- def refinementIndexFormula {n : Nat} (z level C E U Rf Rc : Fin n) : BoundedFormula n :=
215
- nonemptyTupleFormula 5 z ![level, C, E, U, Rf, Rc]
216
-
217
- theorem truth_refinementIndexFormula {n : Nat} (z level C E U Rf Rc : Fin n)
218
- (env : Fin n → ZFSet.{u}) :
219
- Truth (refinementIndexFormula z level C E U Rf Rc) env ↔
220
- env z = refinementIndexCode (env level) (env C) (env E) (env U) (env Rf) (env Rc) := by
221
- rw [refinementIndexFormula, truth_nonemptyTupleFormula]
222
- rfl
223
-
224
- end BoundedFormula
225
-
226
- end PartitionPilot.Forcing
227
-
228
-
229
-
230
- namespace PartitionPilot.Forcing.TransitiveGround
231
- open SetFormula
232
- universe u
233
- variable (M : TransitiveGround.{u})
234
-
235
- theorem refinementIndexCode_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
236
- {level C E U Rf Rc : ZFSet.{u}} (hl : level ∈ M.sets) (hC : C ∈ M.sets)
237
- (hE : E ∈ M.sets) (hU : U ∈ M.sets) (hf : Rf ∈ M.sets) (hc : Rc ∈ M.sets) :
238
- refinementIndexCode level C E U Rf Rc ∈ M.sets :=
239
- M.nonemptyTupleCode_mem pairing 5 _
240
- (Fin.cases hl (Fin.cases hC (Fin.cases hE (Fin.cases hU
241
- (Fin.cases hf (Fin.cases hc (fun j => Fin.elim0 j)))))))
242
-
243
- theorem refinementIndexCode_fields_mem {level C E U Rf Rc : ZFSet.{u}}
244
- (ground : refinementIndexCode level C E U Rf Rc ∈ M.sets) :
245
- level ∈ M.sets ∧ C ∈ M.sets ∧ E ∈ M.sets ∧ U ∈ M.sets ∧
246
- Rf ∈ M.sets ∧ Rc ∈ M.sets := by
247
- have fields := M.nonemptyTupleCode_field_mem 5 ![level, C, E, U, Rf, Rc] ground
248
- exact ⟨fields 0, fields 1, fields 2, fields 3, fields 4, fields 5⟩
249
-
250
- theorem refinementIndexBound_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
251
- (unions : Realize M.sets SetFormula.union Fin.elim0)
252
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
253
- {L P V W : ZFSet.{u}} (hL : L ∈ M.sets) (hP : P ∈ M.sets)
254
- (hV : V ∈ M.sets) (hW : W ∈ M.sets) : refinementIndexBound L P V W ∈ M.sets :=
255
- M.prod_mem pairing unions powers separation hL
256
- (M.prod_mem pairing unions powers separation hP
257
- (M.prod_mem pairing unions powers separation hP
258
- (M.prod_mem pairing unions powers separation hV
259
- (M.prod_mem pairing unions powers separation hW hW))))
260
-
261
- end PartitionPilot.Forcing.TransitiveGround
262
-
263
-
264
-
265
- namespace PartitionPilot.Forcing
266
- open SetFormula
267
- universe u
268
-
269
- noncomputable def refinementIndexFieldGraph (I B : ZFSet.{u}) (j : Fin 6) : ZFSet.{u} :=
270
- ZFSet.sep (fun z => ∃ fields : Fin 6 → ZFSet.{u},
271
- nonemptyTupleCode 5 fields ∈ I ∧ z = ZFSet.pair (nonemptyTupleCode 5 fields) (fields j))
272
- (ZFSet.prod I B)
273
-
274
- theorem pair_mem_refinementIndexFieldGraph (I B x y : ZFSet.{u}) (j : Fin 6) :
275
- ZFSet.pair x y ∈ refinementIndexFieldGraph I B j ↔
276
- x ∈ I ∧ y ∈ B ∧ ∃ fields : Fin 6 → ZFSet.{u}, x = nonemptyTupleCode 5 fields ∧ y = fields j := by
277
- rw [refinementIndexFieldGraph, ZFSet.mem_sep, ZFSet.pair_mem_prod]
278
- constructor
279
- · rintro ⟨⟨hx, hy⟩, fields, _, eq⟩
280
- exact ⟨hx, hy, fields, ZFSet.pair_inj.1 eq⟩
281
- · rintro ⟨hx, hy, fields, rfl, rfl⟩
282
- exact ⟨⟨hx, hy⟩, fields, hx, rfl⟩
283
-
284
- theorem refinementIndexFieldGraph_entry (I B : ZFSet.{u}) (fields : Fin 6 → ZFSet.{u})
285
- (j : Fin 6) (y : ZFSet.{u}) :
286
- ZFSet.pair (nonemptyTupleCode 5 fields) y ∈ refinementIndexFieldGraph I B j ↔
287
- nonemptyTupleCode 5 fields ∈ I ∧ y ∈ B ∧ y = fields j := by
288
- rw [pair_mem_refinementIndexFieldGraph]
289
- constructor
290
- · rintro ⟨hi, hy, fields', equal, value⟩
291
- have same := nonemptyTupleCode_injective 5 equal
292
- exact ⟨hi, hy, value.trans (congrFun same j).symm⟩
293
- · rintro ⟨hi, hy, value⟩
294
- exact ⟨hi, hy, fields, rfl, value⟩
295
-
296
- theorem refinementIndexFieldGraph_function (I B : ZFSet.{u}) (j : Fin 6)
297
- (fields : ∀ x ∈ I, ∃ v : Fin 6 → ZFSet.{u}, x = nonemptyTupleCode 5 v ∧ v j ∈ B) :
298
- ZFSet.IsFunc I B (refinementIndexFieldGraph I B j) := by
299
- refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩
300
- intro x hx
301
- obtain ⟨v, rfl, hv⟩ := fields x hx
302
- refine ⟨v j, (refinementIndexFieldGraph_entry I B v j _).2 ⟨hx, hv, rfl⟩, ?_⟩
303
- intro y hy
304
- exact ((refinementIndexFieldGraph_entry I B v j y).1 hy).2.2
305
-
306
- namespace SetFormula
307
-
308
- def refinementIndexFieldFormula {n} (z I : Fin n) (j : Fin 6) : SetFormula n :=
309
- let old := suffixIndex n 7
310
- let w := prefixIndex n 7
311
- exBlock 7 (.conj (.mem (w 0) (old I))
312
- (.conj (BoundedFormula.nonemptyTupleFormula 5 (w 0) (fun k => w k.succ)).toFormula
313
- (BoundedFormula.orderedPairFormula (old z) (w 0) (w j.succ)).toFormula))
314
-
315
- end SetFormula
316
-
317
- namespace TransitiveGround
318
- variable (M : TransitiveGround.{u})
319
-
320
- theorem realize_refinementIndexFieldFormula {n} (z I : Fin n) (j : Fin 6)
321
- (env : Fin n → ZFSet.{u}) (members : ∀ k, env k ∈ M.sets) :
322
- Realize M.sets (refinementIndexFieldFormula z I j) env ↔
323
- ∃ fields : Fin 6 → ZFSet.{u}, nonemptyTupleCode 5 fields ∈ env I ∧
324
- env z = ZFSet.pair (nonemptyTupleCode 5 fields) (fields j) := by
325
- rw [refinementIndexFieldFormula, realize_exBlock]
326
- have actual (w : Fin 7 → ZFSet.{u}) (ground : ∀ k, w k ∈ M.sets) :
327
- Realize M.sets (.conj (.mem (prefixIndex n 7 0) (suffixIndex n 7 I))
328
- (.conj (BoundedFormula.nonemptyTupleFormula 5 (prefixIndex n 7 0)
329
- (fun k => prefixIndex n 7 k.succ)).toFormula
330
- (BoundedFormula.orderedPairFormula (suffixIndex n 7 z) (prefixIndex n 7 0)
331
- (prefixIndex n 7 j.succ)).toFormula)) (extendMany 7 w env) ↔
332
- w 0 ∈ env I ∧ w 0 = nonemptyTupleCode 5 (fun k => w k.succ) ∧
333
- env z = ZFSet.pair (w 0) (w j.succ) := by
334
- simp only [Realize, BoundedFormula.realize_toFormula M _ _
335
- (extendMany_members 7 w env ground members), BoundedFormula.truth_nonemptyTupleFormula,
336
- BoundedFormula.truth_orderedPairFormula, extendMany_prefix, extendMany_suffix]
337
- constructor
338
- · rintro ⟨w, ground, holds⟩
339
- obtain ⟨hi, eq, pair⟩ := (actual w ground).1 holds
340
- exact ⟨fun k => w k.succ, eq ▸ hi, eq ▸ pair⟩
341
- · rintro ⟨fields, hi, pair⟩
342
- have hcode := M.transitive (members I) hi
343
- have hf := M.nonemptyTupleCode_field_mem 5 fields hcode
344
- let w := extend (nonemptyTupleCode 5 fields) fields
345
- have ground : ∀ k, w k ∈ M.sets := Fin.cases hcode hf
346
- exact ⟨w, ground, (actual w ground).2 ⟨hi, rfl, pair⟩⟩
347
-
348
- theorem refinementIndexFieldGraph_mem
349
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
350
- (unions : Realize M.sets SetFormula.union Fin.elim0)
351
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
352
- {I B : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets) (j : Fin 6) :
353
- refinementIndexFieldGraph I B j ∈ M.sets := by
354
- have hp := M.prod_mem pairing unions powers separation hI hB
355
- let params := extend I Fin.elim0
356
- have ground := M.separation_mem separation (refinementIndexFieldFormula 0 1 j)
357
- params (Fin.cases hI (fun k => Fin.elim0 k)) hp
358
- have equal : ZFSet.sep (fun z => Realize M.sets (refinementIndexFieldFormula 0 1 j)
359
- (extend z params)) (ZFSet.prod I B) = refinementIndexFieldGraph I B j := by
360
- apply ZFSet.ext
361
- intro z
362
- rw [ZFSet.mem_sep, refinementIndexFieldGraph, ZFSet.mem_sep]
363
- apply and_congr_right
364
- intro hz
365
- exact M.realize_refinementIndexFieldFormula 0 1 j _
366
- (Fin.cases (M.transitive hp hz) (Fin.cases hI (fun k => Fin.elim0 k)))
367
- exact equal ▸ ground
368
-
369
- end TransitiveGround
370
-
371
- end PartitionPilot.Forcing
372
-
373
-
374
-
375
- namespace PartitionPilot.Forcing.TransitiveGround
376
-
377
- open SetFormula
378
- open scoped ZFSet
379
- universe u
380
- variable (M : TransitiveGround.{u})
381
-
382
- theorem graphRestriction_mem
383
- (unions : Realize M.sets SetFormula.union Fin.elim0)
384
- (separation : SeparationSchema M.sets)
385
- {A f : ZFSet.{u}} (hA : A ∈ M.sets) (hf : f ∈ M.sets) :
386
- graphRestriction A f ∈ M.sets :=
387
- M.injection_restriction_mem separation hA (M.union_mem unions (M.union_mem unions hf)) hf
388
-
389
- theorem functionGraphOn_ground_range
390
- (unions : Realize M.sets SetFormula.union Fin.elim0)
391
- {A f : ZFSet.{u}} (hf : f ∈ M.sets) (h : FunctionGraphOn A f) :
392
- ∃ B ∈ M.sets, ZFSet.IsFunc A B f :=
393
- ⟨⋃₀ ⋃₀ f, M.union_mem unions (M.union_mem unions hf), h.to_isFunc⟩
394
-
395
- end PartitionPilot.Forcing.TransitiveGround
396
-
397
-
398
-
399
- namespace PartitionPilot.Forcing
400
- open SetFormula
401
- open scoped ZFSet
402
- universe u
403
-
404
- noncomputable def tupleFieldBound : Nat → ZFSet.{u} → ZFSet.{u}
405
- | 0, B => B
406
- | k + 1, B => (⋃₀ ⋃₀ B) ∪ tupleFieldBound k (⋃₀ ⋃₀ B)
407
-
408
- theorem nonemptyTupleCode_field_mem_bound (k : Nat) (fields : Fin (k + 1) → ZFSet.{u})
409
- {B : ZFSet.{u}} (member : nonemptyTupleCode k fields ∈ B) :
410
- ∀ j, fields j ∈ tupleFieldBound k B := by
411
- induction k generalizing B with
412
- | zero => exact Fin.cases member (fun j => Fin.elim0 j)
413
- | succ k ih =>
414
- have pair : ZFSet.pair (fields 0) (nonemptyTupleCode k (fun j => fields j.succ)) ∈ B := member
415
- exact Fin.cases (ZFSet.mem_union.2 (Or.inl (pair_first_mem_doubleUnion pair)))
416
- (fun j => ZFSet.mem_union.2 (Or.inr (ih _ (pair_second_mem_doubleUnion pair) j)))
417
-
418
- namespace BoundedFormula
419
- noncomputable def tupleFieldFormula : (k : Nat) → {n : Nat} → Fin n → Fin n → Fin (k + 1) → BoundedFormula n
420
- | 0, _, z, y, _ => .equal y z
421
- | k + 1, _, z, y, j => exPairFields z
422
- (Fin.cases (.conj (.equal y.succ.succ 1) (tupleShapeFormula k 0))
423
- (fun i => tupleFieldFormula k 0 y.succ.succ i) j)
424
-
425
- theorem truth_tupleFieldFormula (k : Nat) {n : Nat} (z y : Fin n) (j : Fin (k + 1))
426
- (env : Fin n → ZFSet.{u}) :
427
- Truth (tupleFieldFormula k z y j) env ↔
428
- ∃ fields : Fin (k + 1) → ZFSet.{u}, env z = nonemptyTupleCode k fields ∧ env y = fields j := by
429
- induction k generalizing n with
430
- | zero =>
431
- change env y = env z ↔ ∃ fields : Fin 1 → ZFSet.{u}, env z = fields 0 ∧ env y = fields j
432
- constructor
433
- · intro equal
434
- exact ⟨fun _ => env z, rfl, equal⟩
435
- · rintro ⟨fields, first, second⟩
436
- have eq : j = 0 := Fin.cases rfl (fun i => Fin.elim0 i) j
437
- exact (eq ▸ second).trans first.symm
438
- | succ k ih =>
439
- rw [tupleFieldFormula, truth_exPairFields]
440
- refine Fin.cases ?_ (fun i => ?_) j
441
- · simp only [Fin.cases_zero, Truth, truth_tupleShapeFormula]
442
- constructor
443
- · rintro ⟨head, tail, pair, value, fields, tuple⟩
444
- let all : Fin (k + 2) → ZFSet.{u} := Fin.cases head fields
445
- refine ⟨all, ?_, ?_⟩
446
- · change env z = ZFSet.pair head (nonemptyTupleCode k fields)
447
- exact pair.trans (congrArg (ZFSet.pair head) tuple)
448
- · exact value
449
- · rintro ⟨fields, pair, value⟩
450
- exact ⟨fields 0, nonemptyTupleCode k (fun i => fields i.succ), pair,
451
- value, fun i => fields i.succ, rfl⟩
452
- · simp only [Fin.cases_succ, ih]
453
- constructor
454
- · rintro ⟨head, tail, pair, fields, tuple, value⟩
455
- let all : Fin (k + 2) → ZFSet.{u} := Fin.cases head fields
456
- refine ⟨all, ?_, ?_⟩
457
- · change env z = ZFSet.pair head (nonemptyTupleCode k fields)
458
- exact pair.trans (congrArg (ZFSet.pair head) tuple)
459
- · exact value
460
- · rintro ⟨fields, pair, value⟩
461
- exact ⟨fields 0, nonemptyTupleCode k (fun i => fields i.succ), pair,
462
- fun i => fields i.succ, rfl, value⟩
463
-
464
- end BoundedFormula
465
-
466
- namespace TransitiveGround
467
- variable (M : TransitiveGround.{u})
468
- theorem tupleFieldBound_mem
469
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
470
- (unions : Realize M.sets SetFormula.union Fin.elim0)
471
- (k : Nat) {B : ZFSet.{u}} (ground : B ∈ M.sets) : tupleFieldBound k B ∈ M.sets := by
472
- induction k generalizing B with
473
- | zero => exact ground
474
- | succ k ih =>
475
- have hB := M.union_mem unions (M.union_mem unions ground)
476
- exact M.binary_union_mem pairing unions hB (ih hB)
477
-
478
- end TransitiveGround
479
-
480
- end PartitionPilot.Forcing
481
-
482
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Models.GroundInjectionRestrictions
2
+
3
+ namespace OAI
4
+
5
+
6
+ namespace PartitionPilot.Forcing
7
+
8
+ universe u
9
+
10
+ noncomputable def nonemptyTupleCode : (k : Nat) → (Fin (k + 1) → ZFSet.{u}) → ZFSet.{u}
11
+ | 0, fields => fields 0
12
+ | k + 1, fields => ZFSet.pair (fields 0) (nonemptyTupleCode k (fun i => fields i.succ))
13
+
14
+ theorem nonemptyTupleCode_injective (k : Nat) : Function.Injective (nonemptyTupleCode.{u} k) := by
15
+ induction k with
16
+ | zero =>
17
+ intro fields fields' equal
18
+ funext i
19
+ exact Fin.cases equal (fun j => Fin.elim0 j) i
20
+ | succ k ih =>
21
+ intro fields fields' equal
22
+ obtain ⟨head, tail⟩ := ZFSet.pair_inj.1 equal
23
+ have same := ih tail
24
+ funext i
25
+ exact Fin.cases head (fun j => congrFun same j) i
26
+
27
+ namespace BoundedFormula
28
+
29
+ open SetFormula
30
+
31
+ def nonemptyTupleFormula : (k : Nat) → {n : Nat} →
32
+ Fin n → (Fin (k + 1) → Fin n) → BoundedFormula n
33
+ | 0, _, z, fields => .equal z (fields 0)
34
+ | k + 1, _, z, fields => exMem z (exMem 0
35
+ (.conj (orderedPairFormula z.succ.succ (fields 0).succ.succ 0)
36
+ (nonemptyTupleFormula k 0 (fun i => (fields i.succ).succ.succ))))
37
+
38
+ theorem truth_nonemptyTupleFormula (k : Nat) {n : Nat} (z : Fin n)
39
+ (fields : Fin (k + 1) → Fin n) (env : Fin n → ZFSet.{u}) :
40
+ Truth (nonemptyTupleFormula k z fields) env ↔
41
+ env z = nonemptyTupleCode k (fun i => env (fields i)) := by
42
+ induction k generalizing n with
43
+ | zero => rfl
44
+ | succ k ih =>
45
+ simp only [nonemptyTupleFormula, truth_exMem, Truth, truth_orderedPairFormula, ih]
46
+ change (∃ a ∈ env z, ∃ b ∈ a, env z = ZFSet.pair (env (fields 0)) b ∧
47
+ b = nonemptyTupleCode k (fun i => env (fields i.succ))) ↔ _
48
+ constructor
49
+ · rintro ⟨_, _, b, _, outer, tail⟩
50
+ rw [outer, tail]
51
+ rfl
52
+ · intro equal
53
+ let tail := nonemptyTupleCode k (fun i => env (fields i.succ))
54
+ have outer : env z = ZFSet.pair (env (fields 0)) tail := equal
55
+ refine ⟨{env (fields 0), tail}, ?_, tail, ZFSet.mem_pair.2 (Or.inr rfl), outer, rfl⟩
56
+ rw [outer]
57
+ exact ZFSet.mem_pair.2 (Or.inr rfl)
58
+
59
+ end BoundedFormula
60
+
61
+ namespace TransitiveGround
62
+
63
+ open SetFormula
64
+ variable (M : TransitiveGround.{u})
65
+
66
+ theorem nonemptyTupleCode_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
67
+ (k : Nat) (fields : Fin (k + 1) → ZFSet.{u}) (ground : ∀ i, fields i ∈ M.sets) :
68
+ nonemptyTupleCode k fields ∈ M.sets := by
69
+ induction k with
70
+ | zero => exact ground 0
71
+ | succ k ih => exact M.orderedPair_mem pairing (ground 0) (ih _ (fun i => ground i.succ))
72
+
73
+ theorem nonemptyTupleCode_field_mem (k : Nat) (fields : Fin (k + 1) → ZFSet.{u})
74
+ (ground : nonemptyTupleCode k fields ∈ M.sets) : ∀ i, fields i ∈ M.sets := by
75
+ induction k with
76
+ | zero => exact Fin.cases ground (fun i => Fin.elim0 i)
77
+ | succ k ih =>
78
+ have pairGround : ZFSet.pair (fields 0) (nonemptyTupleCode k (fun i => fields i.succ)) ∈ M.sets := ground
79
+ have both : ({fields 0, nonemptyTupleCode k (fun i => fields i.succ)} : ZFSet.{u}) ∈ M.sets :=
80
+ M.transitive pairGround (ZFSet.mem_pair.2 (Or.inr rfl))
81
+ have head := M.transitive both (ZFSet.mem_pair.2 (Or.inl rfl))
82
+ have tail := M.transitive both (ZFSet.mem_pair.2 (Or.inr rfl))
83
+ exact Fin.cases head (ih _ tail)
84
+
85
+ end TransitiveGround
86
+
87
+ end PartitionPilot.Forcing
88
+
89
+
90
+
91
+ namespace PartitionPilot.Forcing.BoundedFormula
92
+ open SetFormula
93
+ universe u
94
+
95
+ def reindex : {n m : Nat} → (Fin n → Fin m) → BoundedFormula n → BoundedFormula m
96
+ | _, _, f, .equal i j => .equal (f i) (f j)
97
+ | _, _, f, .mem i j => .mem (f i) (f j)
98
+ | _, _, f, .neg φ => .neg (reindex f φ)
99
+ | _, _, f, .conj φ ψ => .conj (reindex f φ) (reindex f ψ)
100
+ | _, _, f, .allMem b φ => .allMem (f b) (reindex (liftIndex f) φ)
101
+
102
+ theorem truth_reindex {n m} (f : Fin n → Fin m) (φ : BoundedFormula n)
103
+ (env : Fin m → ZFSet.{u}) :
104
+ Truth (reindex f φ) env ↔ Truth φ (fun i => env (f i)) := by
105
+ induction φ generalizing m with
106
+ | equal i j => rfl
107
+ | mem i j => rfl
108
+ | neg φ ih => exact not_congr (ih f env)
109
+ | conj φ ψ ihφ ihψ => exact and_congr (ihφ f env) (ihψ f env)
110
+ | allMem b φ ih =>
111
+ change (∀ x ∈ env (f b), Truth (reindex (liftIndex f) φ) (extend x env)) ↔ _
112
+ apply forall_congr'
113
+ intro x
114
+ apply forall_congr'
115
+ intro _
116
+ rw [ih, extend_liftIndex]
117
+
118
+ def exPairFields {n} (z : Fin n) (body : BoundedFormula (n + 2)) : BoundedFormula n :=
119
+ exMem z (exMem 0 (exMem z.succ.succ (exMem 0
120
+ (.conj (orderedPairFormula z.succ.succ.succ.succ 2 0)
121
+ (reindex (Fin.cases 0 (Fin.cases 2 (fun i => i.succ.succ.succ.succ))) body)))))
122
+
123
+ theorem truth_exPairFields {n} (z : Fin n) (body : BoundedFormula (n + 2))
124
+ (env : Fin n → ZFSet.{u}) :
125
+ Truth (exPairFields z body) env ↔
126
+ ∃ x y, env z = ZFSet.pair x y ∧ Truth body (extend y (extend x env)) := by
127
+ simp only [exPairFields, truth_exMem, Truth, truth_orderedPairFormula, truth_reindex]
128
+ have rearrange (a x b y : ZFSet.{u}) :
129
+ (fun i => extend y (extend b (extend x (extend a env)))
130
+ (Fin.cases 0 (Fin.cases 2 (fun j => j.succ.succ.succ.succ)) i)) =
131
+ extend y (extend x env) := by
132
+ funext i
133
+ refine Fin.cases ?_ (fun j => Fin.cases ?_ (fun k => ?_) j) i <;> rfl
134
+ simp only [rearrange]
135
+ change (∃ a ∈ env z, ∃ x ∈ a, ∃ b ∈ env z, ∃ y ∈ b,
136
+ env z = ZFSet.pair x y ∧ Truth body (extend y (extend x env))) ↔ _
137
+ constructor
138
+ · rintro ⟨a, _, x, _, b, _, y, _, equal, holds⟩
139
+ exact ⟨x, y, equal, holds⟩
140
+ · rintro ⟨x, y, equal, holds⟩
141
+ have both : ({x, y} : ZFSet.{u}) ∈ env z := by
142
+ rw [equal]
143
+ exact ZFSet.mem_pair.2 (Or.inr rfl)
144
+ exact ⟨{x,y}, both, x, ZFSet.mem_pair.2 (Or.inl rfl),
145
+ {x,y}, both, y, ZFSet.mem_pair.2 (Or.inr rfl), equal, holds⟩
146
+
147
+ def tupleShapeFormula : (k : Nat) → {n : Nat} → Fin n → BoundedFormula n
148
+ | 0, _, z => .equal z z
149
+ | k + 1, _, z => exPairFields z (tupleShapeFormula k 0)
150
+
151
+ theorem truth_tupleShapeFormula (k : Nat) {n} (z : Fin n) (env : Fin n → ZFSet.{u}) :
152
+ Truth (tupleShapeFormula k z) env ↔ ∃ fields, env z = nonemptyTupleCode k fields := by
153
+ induction k generalizing n with
154
+ | zero =>
155
+ change env z = env z ↔ ∃ fields : Fin 1 → ZFSet.{u}, env z = fields 0
156
+ exact ⟨fun _ => ⟨fun _ => env z, rfl⟩, fun _ => rfl⟩
157
+ | succ k ih =>
158
+ rw [tupleShapeFormula, truth_exPairFields]
159
+ constructor
160
+ · rintro ⟨x, y, equal, shape⟩
161
+ obtain ⟨fields, tail⟩ := (ih 0 (extend y (extend x env))).1 shape
162
+ refine ⟨Fin.cases x fields, ?_⟩
163
+ change env z = ZFSet.pair x (nonemptyTupleCode k fields)
164
+ exact equal.trans (congrArg (ZFSet.pair x) tail)
165
+ · rintro ⟨fields, equal⟩
166
+ exact ⟨fields 0, nonemptyTupleCode k (fun i => fields i.succ), equal,
167
+ (ih 0 _).2 ⟨fun i => fields i.succ, rfl⟩⟩
168
+
169
+ end PartitionPilot.Forcing.BoundedFormula
170
+
171
+
172
+
173
+ namespace PartitionPilot.Forcing
174
+ universe u
175
+
176
+ noncomputable def refinementIndexCode (level C E U Rf Rc : ZFSet.{u}) : ZFSet.{u} :=
177
+ nonemptyTupleCode 5 ![level, C, E, U, Rf, Rc]
178
+
179
+ theorem refinementIndexCode_eq_iff (level C E U Rf Rc level' C' E' U' Rf' Rc' : ZFSet.{u}) :
180
+ refinementIndexCode level C E U Rf Rc = refinementIndexCode level' C' E' U' Rf' Rc' ↔
181
+ level = level' ∧ C = C' ∧ E = E' ∧ U = U' ∧ Rf = Rf' ∧ Rc = Rc' := by
182
+ simp only [refinementIndexCode, nonemptyTupleCode, Matrix.cons_val_zero,
183
+ Matrix.cons_val_succ, ZFSet.pair_inj]
184
+
185
+ noncomputable def refinementIndexBound (L P V W : ZFSet.{u}) : ZFSet.{u} :=
186
+ ZFSet.prod L (ZFSet.prod P (ZFSet.prod P (ZFSet.prod V (ZFSet.prod W W))))
187
+
188
+ theorem mem_refinementIndexBound (L P V W z : ZFSet.{u}) :
189
+ z ∈ refinementIndexBound L P V W ↔
190
+ ∃ level ∈ L, ∃ C ∈ P, ∃ E ∈ P, ∃ U ∈ V, ∃ Rf ∈ W, ∃ Rc ∈ W,
191
+ z = refinementIndexCode level C E U Rf Rc := by
192
+ simp only [refinementIndexBound, ZFSet.mem_prod]
193
+ constructor
194
+ · rintro ⟨level, hlevel, rest, ⟨C, hC, rest', ⟨E, hE, rest'', ⟨U, hU,
195
+ rest''', ⟨Rf, hRf, Rc, hRc, rfl⟩, rfl⟩, rfl⟩, rfl⟩, rfl⟩
196
+ exact ⟨level, hlevel, C, hC, E, hE, U, hU, Rf, hRf, Rc, hRc, rfl⟩
197
+ · rintro ⟨level, hlevel, C, hC, E, hE, U, hU, Rf, hRf, Rc, hRc, rfl⟩
198
+ exact ⟨level, hlevel, _, ⟨C, hC, _, ⟨E, hE, _, ⟨U, hU, _,
199
+ ⟨Rf, hRf, Rc, hRc, rfl⟩, rfl⟩, rfl⟩, rfl⟩, rfl⟩
200
+
201
+ theorem refinementIndexCode_mem_bound (L P V W level C E U Rf Rc : ZFSet.{u}) :
202
+ refinementIndexCode level C E U Rf Rc ∈ refinementIndexBound L P V W ↔
203
+ level ∈ L ∧ C ∈ P ∧ E ∈ P ∧ U ∈ V ∧ Rf ∈ W ∧ Rc ∈ W := by
204
+ rw [mem_refinementIndexBound]
205
+ constructor
206
+ · rintro ⟨l, hl, c, hc, e, he, a, ha, r, hr, t, ht, equal⟩
207
+ obtain ⟨rfl, rfl, rfl, rfl, rfl, rfl⟩ := (refinementIndexCode_eq_iff _ _ _ _ _ _ _ _ _ _ _ _).1 equal
208
+ exact ⟨hl, hc, he, ha, hr, ht⟩
209
+ · rintro ⟨hl, hc, he, hu, hf, hr⟩
210
+ exact ⟨level, hl, C, hc, E, he, U, hu, Rf, hf, Rc, hr, rfl⟩
211
+
212
+ namespace BoundedFormula
213
+
214
+ def refinementIndexFormula {n : Nat} (z level C E U Rf Rc : Fin n) : BoundedFormula n :=
215
+ nonemptyTupleFormula 5 z ![level, C, E, U, Rf, Rc]
216
+
217
+ theorem truth_refinementIndexFormula {n : Nat} (z level C E U Rf Rc : Fin n)
218
+ (env : Fin n → ZFSet.{u}) :
219
+ Truth (refinementIndexFormula z level C E U Rf Rc) env ↔
220
+ env z = refinementIndexCode (env level) (env C) (env E) (env U) (env Rf) (env Rc) := by
221
+ rw [refinementIndexFormula, truth_nonemptyTupleFormula]
222
+ rfl
223
+
224
+ end BoundedFormula
225
+
226
+ end PartitionPilot.Forcing
227
+
228
+
229
+
230
+ namespace PartitionPilot.Forcing.TransitiveGround
231
+ open SetFormula
232
+ universe u
233
+ variable (M : TransitiveGround.{u})
234
+
235
+ theorem refinementIndexCode_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
236
+ {level C E U Rf Rc : ZFSet.{u}} (hl : level ∈ M.sets) (hC : C ∈ M.sets)
237
+ (hE : E ∈ M.sets) (hU : U ∈ M.sets) (hf : Rf ∈ M.sets) (hc : Rc ∈ M.sets) :
238
+ refinementIndexCode level C E U Rf Rc ∈ M.sets :=
239
+ M.nonemptyTupleCode_mem pairing 5 _
240
+ (Fin.cases hl (Fin.cases hC (Fin.cases hE (Fin.cases hU
241
+ (Fin.cases hf (Fin.cases hc (fun j => Fin.elim0 j)))))))
242
+
243
+ theorem refinementIndexCode_fields_mem {level C E U Rf Rc : ZFSet.{u}}
244
+ (ground : refinementIndexCode level C E U Rf Rc ∈ M.sets) :
245
+ level ∈ M.sets ∧ C ∈ M.sets ∧ E ∈ M.sets ∧ U ∈ M.sets ∧
246
+ Rf ∈ M.sets ∧ Rc ∈ M.sets := by
247
+ have fields := M.nonemptyTupleCode_field_mem 5 ![level, C, E, U, Rf, Rc] ground
248
+ exact ⟨fields 0, fields 1, fields 2, fields 3, fields 4, fields 5⟩
249
+
250
+ theorem refinementIndexBound_mem (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
251
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
252
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
253
+ {L P V W : ZFSet.{u}} (hL : L ∈ M.sets) (hP : P ∈ M.sets)
254
+ (hV : V ∈ M.sets) (hW : W ∈ M.sets) : refinementIndexBound L P V W ∈ M.sets :=
255
+ M.prod_mem pairing unions powers separation hL
256
+ (M.prod_mem pairing unions powers separation hP
257
+ (M.prod_mem pairing unions powers separation hP
258
+ (M.prod_mem pairing unions powers separation hV
259
+ (M.prod_mem pairing unions powers separation hW hW))))
260
+
261
+ end PartitionPilot.Forcing.TransitiveGround
262
+
263
+
264
+
265
+ namespace PartitionPilot.Forcing
266
+ open SetFormula
267
+ universe u
268
+
269
+ noncomputable def refinementIndexFieldGraph (I B : ZFSet.{u}) (j : Fin 6) : ZFSet.{u} :=
270
+ ZFSet.sep (fun z => ∃ fields : Fin 6 → ZFSet.{u},
271
+ nonemptyTupleCode 5 fields ∈ I ∧ z = ZFSet.pair (nonemptyTupleCode 5 fields) (fields j))
272
+ (ZFSet.prod I B)
273
+
274
+ theorem pair_mem_refinementIndexFieldGraph (I B x y : ZFSet.{u}) (j : Fin 6) :
275
+ ZFSet.pair x y ∈ refinementIndexFieldGraph I B j ↔
276
+ x ∈ I ∧ y ∈ B ∧ ∃ fields : Fin 6 → ZFSet.{u}, x = nonemptyTupleCode 5 fields ∧ y = fields j := by
277
+ rw [refinementIndexFieldGraph, ZFSet.mem_sep, ZFSet.pair_mem_prod]
278
+ constructor
279
+ · rintro ⟨⟨hx, hy⟩, fields, _, eq⟩
280
+ exact ⟨hx, hy, fields, ZFSet.pair_inj.1 eq⟩
281
+ · rintro ⟨hx, hy, fields, rfl, rfl⟩
282
+ exact ⟨⟨hx, hy⟩, fields, hx, rfl⟩
283
+
284
+ theorem refinementIndexFieldGraph_entry (I B : ZFSet.{u}) (fields : Fin 6 → ZFSet.{u})
285
+ (j : Fin 6) (y : ZFSet.{u}) :
286
+ ZFSet.pair (nonemptyTupleCode 5 fields) y ∈ refinementIndexFieldGraph I B j ↔
287
+ nonemptyTupleCode 5 fields ∈ I ∧ y ∈ B ∧ y = fields j := by
288
+ rw [pair_mem_refinementIndexFieldGraph]
289
+ constructor
290
+ · rintro ⟨hi, hy, fields', equal, value⟩
291
+ have same := nonemptyTupleCode_injective 5 equal
292
+ exact ⟨hi, hy, value.trans (congrFun same j).symm⟩
293
+ · rintro ⟨hi, hy, value⟩
294
+ exact ⟨hi, hy, fields, rfl, value⟩
295
+
296
+ theorem refinementIndexFieldGraph_function (I B : ZFSet.{u}) (j : Fin 6)
297
+ (fields : ∀ x ∈ I, ∃ v : Fin 6 → ZFSet.{u}, x = nonemptyTupleCode 5 v ∧ v j ∈ B) :
298
+ ZFSet.IsFunc I B (refinementIndexFieldGraph I B j) := by
299
+ refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩
300
+ intro x hx
301
+ obtain ⟨v, rfl, hv⟩ := fields x hx
302
+ refine ⟨v j, (refinementIndexFieldGraph_entry I B v j _).2 ⟨hx, hv, rfl⟩, ?_⟩
303
+ intro y hy
304
+ exact ((refinementIndexFieldGraph_entry I B v j y).1 hy).2.2
305
+
306
+ namespace SetFormula
307
+
308
+ def refinementIndexFieldFormula {n} (z I : Fin n) (j : Fin 6) : SetFormula n :=
309
+ let old := suffixIndex n 7
310
+ let w := prefixIndex n 7
311
+ exBlock 7 (.conj (.mem (w 0) (old I))
312
+ (.conj (BoundedFormula.nonemptyTupleFormula 5 (w 0) (fun k => w k.succ)).toFormula
313
+ (BoundedFormula.orderedPairFormula (old z) (w 0) (w j.succ)).toFormula))
314
+
315
+ end SetFormula
316
+
317
+ namespace TransitiveGround
318
+ variable (M : TransitiveGround.{u})
319
+
320
+ theorem realize_refinementIndexFieldFormula {n} (z I : Fin n) (j : Fin 6)
321
+ (env : Fin n → ZFSet.{u}) (members : ∀ k, env k ∈ M.sets) :
322
+ Realize M.sets (refinementIndexFieldFormula z I j) env ↔
323
+ ∃ fields : Fin 6 → ZFSet.{u}, nonemptyTupleCode 5 fields ∈ env I ∧
324
+ env z = ZFSet.pair (nonemptyTupleCode 5 fields) (fields j) := by
325
+ rw [refinementIndexFieldFormula, realize_exBlock]
326
+ have actual (w : Fin 7 → ZFSet.{u}) (ground : ∀ k, w k ∈ M.sets) :
327
+ Realize M.sets (.conj (.mem (prefixIndex n 7 0) (suffixIndex n 7 I))
328
+ (.conj (BoundedFormula.nonemptyTupleFormula 5 (prefixIndex n 7 0)
329
+ (fun k => prefixIndex n 7 k.succ)).toFormula
330
+ (BoundedFormula.orderedPairFormula (suffixIndex n 7 z) (prefixIndex n 7 0)
331
+ (prefixIndex n 7 j.succ)).toFormula)) (extendMany 7 w env) ↔
332
+ w 0 ∈ env I ∧ w 0 = nonemptyTupleCode 5 (fun k => w k.succ) ∧
333
+ env z = ZFSet.pair (w 0) (w j.succ) := by
334
+ simp only [Realize, BoundedFormula.realize_toFormula M _ _
335
+ (extendMany_members 7 w env ground members), BoundedFormula.truth_nonemptyTupleFormula,
336
+ BoundedFormula.truth_orderedPairFormula, extendMany_prefix, extendMany_suffix]
337
+ constructor
338
+ · rintro ⟨w, ground, holds⟩
339
+ obtain ⟨hi, eq, pair⟩ := (actual w ground).1 holds
340
+ exact ⟨fun k => w k.succ, eq ▸ hi, eq ▸ pair⟩
341
+ · rintro ⟨fields, hi, pair⟩
342
+ have hcode := M.transitive (members I) hi
343
+ have hf := M.nonemptyTupleCode_field_mem 5 fields hcode
344
+ let w := extend (nonemptyTupleCode 5 fields) fields
345
+ have ground : ∀ k, w k ∈ M.sets := Fin.cases hcode hf
346
+ exact ⟨w, ground, (actual w ground).2 ⟨hi, rfl, pair⟩⟩
347
+
348
+ theorem refinementIndexFieldGraph_mem
349
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
350
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
351
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
352
+ {I B : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets) (j : Fin 6) :
353
+ refinementIndexFieldGraph I B j ∈ M.sets := by
354
+ have hp := M.prod_mem pairing unions powers separation hI hB
355
+ let params := extend I Fin.elim0
356
+ have ground := M.separation_mem separation (refinementIndexFieldFormula 0 1 j)
357
+ params (Fin.cases hI (fun k => Fin.elim0 k)) hp
358
+ have equal : ZFSet.sep (fun z => Realize M.sets (refinementIndexFieldFormula 0 1 j)
359
+ (extend z params)) (ZFSet.prod I B) = refinementIndexFieldGraph I B j := by
360
+ apply ZFSet.ext
361
+ intro z
362
+ rw [ZFSet.mem_sep, refinementIndexFieldGraph, ZFSet.mem_sep]
363
+ apply and_congr_right
364
+ intro hz
365
+ exact M.realize_refinementIndexFieldFormula 0 1 j _
366
+ (Fin.cases (M.transitive hp hz) (Fin.cases hI (fun k => Fin.elim0 k)))
367
+ exact equal ▸ ground
368
+
369
+ end TransitiveGround
370
+
371
+ end PartitionPilot.Forcing
372
+
373
+
374
+
375
+ namespace PartitionPilot.Forcing.TransitiveGround
376
+
377
+ open SetFormula
378
+ open scoped ZFSet
379
+ universe u
380
+ variable (M : TransitiveGround.{u})
381
+
382
+ theorem graphRestriction_mem
383
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
384
+ (separation : SeparationSchema M.sets)
385
+ {A f : ZFSet.{u}} (hA : A ∈ M.sets) (hf : f ∈ M.sets) :
386
+ graphRestriction A f ∈ M.sets :=
387
+ M.injection_restriction_mem separation hA (M.union_mem unions (M.union_mem unions hf)) hf
388
+
389
+ theorem functionGraphOn_ground_range
390
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
391
+ {A f : ZFSet.{u}} (hf : f ∈ M.sets) (h : FunctionGraphOn A f) :
392
+ ∃ B ∈ M.sets, ZFSet.IsFunc A B f :=
393
+ ⟨⋃₀ ⋃₀ f, M.union_mem unions (M.union_mem unions hf), h.to_isFunc⟩
394
+
395
+ end PartitionPilot.Forcing.TransitiveGround
396
+
397
+
398
+
399
+ namespace PartitionPilot.Forcing
400
+ open SetFormula
401
+ open scoped ZFSet
402
+ universe u
403
+
404
+ noncomputable def tupleFieldBound : Nat → ZFSet.{u} → ZFSet.{u}
405
+ | 0, B => B
406
+ | k + 1, B => (⋃₀ ⋃₀ B) ∪ tupleFieldBound k (⋃₀ ⋃₀ B)
407
+
408
+ theorem nonemptyTupleCode_field_mem_bound (k : Nat) (fields : Fin (k + 1) → ZFSet.{u})
409
+ {B : ZFSet.{u}} (member : nonemptyTupleCode k fields ∈ B) :
410
+ ∀ j, fields j ∈ tupleFieldBound k B := by
411
+ induction k generalizing B with
412
+ | zero => exact Fin.cases member (fun j => Fin.elim0 j)
413
+ | succ k ih =>
414
+ have pair : ZFSet.pair (fields 0) (nonemptyTupleCode k (fun j => fields j.succ)) ∈ B := member
415
+ exact Fin.cases (ZFSet.mem_union.2 (Or.inl (pair_first_mem_doubleUnion pair)))
416
+ (fun j => ZFSet.mem_union.2 (Or.inr (ih _ (pair_second_mem_doubleUnion pair) j)))
417
+
418
+ namespace BoundedFormula
419
+ noncomputable def tupleFieldFormula : (k : Nat) → {n : Nat} → Fin n → Fin n → Fin (k + 1) → BoundedFormula n
420
+ | 0, _, z, y, _ => .equal y z
421
+ | k + 1, _, z, y, j => exPairFields z
422
+ (Fin.cases (.conj (.equal y.succ.succ 1) (tupleShapeFormula k 0))
423
+ (fun i => tupleFieldFormula k 0 y.succ.succ i) j)
424
+
425
+ theorem truth_tupleFieldFormula (k : Nat) {n : Nat} (z y : Fin n) (j : Fin (k + 1))
426
+ (env : Fin n → ZFSet.{u}) :
427
+ Truth (tupleFieldFormula k z y j) env ↔
428
+ ∃ fields : Fin (k + 1) → ZFSet.{u}, env z = nonemptyTupleCode k fields ∧ env y = fields j := by
429
+ induction k generalizing n with
430
+ | zero =>
431
+ change env y = env z ↔ ∃ fields : Fin 1 → ZFSet.{u}, env z = fields 0 ∧ env y = fields j
432
+ constructor
433
+ · intro equal
434
+ exact ⟨fun _ => env z, rfl, equal⟩
435
+ · rintro ⟨fields, first, second⟩
436
+ have eq : j = 0 := Fin.cases rfl (fun i => Fin.elim0 i) j
437
+ exact (eq ▸ second).trans first.symm
438
+ | succ k ih =>
439
+ rw [tupleFieldFormula, truth_exPairFields]
440
+ refine Fin.cases ?_ (fun i => ?_) j
441
+ · simp only [Fin.cases_zero, Truth, truth_tupleShapeFormula]
442
+ constructor
443
+ · rintro ⟨head, tail, pair, value, fields, tuple⟩
444
+ let all : Fin (k + 2) → ZFSet.{u} := Fin.cases head fields
445
+ refine ⟨all, ?_, ?_⟩
446
+ · change env z = ZFSet.pair head (nonemptyTupleCode k fields)
447
+ exact pair.trans (congrArg (ZFSet.pair head) tuple)
448
+ · exact value
449
+ · rintro ⟨fields, pair, value⟩
450
+ exact ⟨fields 0, nonemptyTupleCode k (fun i => fields i.succ), pair,
451
+ value, fun i => fields i.succ, rfl⟩
452
+ · simp only [Fin.cases_succ, ih]
453
+ constructor
454
+ · rintro ⟨head, tail, pair, fields, tuple, value⟩
455
+ let all : Fin (k + 2) → ZFSet.{u} := Fin.cases head fields
456
+ refine ⟨all, ?_, ?_⟩
457
+ · change env z = ZFSet.pair head (nonemptyTupleCode k fields)
458
+ exact pair.trans (congrArg (ZFSet.pair head) tuple)
459
+ · exact value
460
+ · rintro ⟨fields, pair, value⟩
461
+ exact ⟨fields 0, nonemptyTupleCode k (fun i => fields i.succ), pair,
462
+ fun i => fields i.succ, rfl, value⟩
463
+
464
+ end BoundedFormula
465
+
466
+ namespace TransitiveGround
467
+ variable (M : TransitiveGround.{u})
468
+ theorem tupleFieldBound_mem
469
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
470
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
471
+ (k : Nat) {B : ZFSet.{u}} (ground : B ∈ M.sets) : tupleFieldBound k B ∈ M.sets := by
472
+ induction k generalizing B with
473
+ | zero => exact ground
474
+ | succ k ih =>
475
+ have hB := M.union_mem unions (M.union_mem unions ground)
476
+ exact M.binary_union_mem pairing unions hB (ih hB)
477
+
478
+ end TransitiveGround
479
+
480
+ end PartitionPilot.Forcing
481
+
482
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/OrbitImageFormulas.lean CHANGED
@@ -1,93 +1,93 @@
1
- import OAI.SetTheory.PartitionPrinciple.Geometry.GroundDefinableSelections
2
-
3
- namespace OAI
4
-
5
-
6
- namespace PartitionPilot.Forcing.SetFormula
7
-
8
- def codedNameActionFormula : SetFormula 5 :=
9
- .conj (domainApplication uniformNameFormula (extend 3 Fin.elim0) 1)
10
- (.conj (domainApplication uniformNameFormula (extend 3 Fin.elim0) 2) nameActionFormula)
11
-
12
- def orbitImageFormula : SetFormula 6 :=
13
- ex (exConditions 5 (.conj (.mem 1 4) (.conj (orderedPairFormula 2 0 1)
14
- (atomicApplication codedNameActionFormula (extend 5 (extend 7 Fin.elim0)) 0 1 3))))
15
-
16
- end PartitionPilot.Forcing.SetFormula
17
-
18
- namespace PartitionPilot.Forcing.TransitiveGround
19
-
20
- open SetRealization SetFormula
21
- universe u
22
- variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P]
23
- variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G)
24
-
25
- theorem realize_codedNameActionFormula
26
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
27
- (unions : Realize M.sets SetFormula.union Fin.elim0)
28
- (powers : Realize M.sets powerSet Fin.elim0)
29
- (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets)
30
- (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets)
31
- (maps : a.conditionMapFamily s t ∈ M.sets)
32
- (g : G) (x y : ZFSet.{u}) (hx : x ∈ M.sets) (hy : y ∈ M.sets) :
33
- Realize M.sets codedNameActionFormula (extend (t.encode g) (extend x (extend y
34
- (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ↔
35
- ∃ σ : (M.nameDomain s).names, σ.val.val = x ∧ y = (a.act s g σ.val).val := by
36
- rw [codedNameActionFormula]
37
- change (Realize M.sets _ _ ∧ Realize M.sets _ _ ∧ Realize M.sets _ _) ↔ _
38
- simp only [realize_domainApplication, map_extend, map_empty]
39
- constructor
40
- · rintro ⟨nameX, nameY, action⟩
41
- have nx := (M.realize_uniformNameFormula s pairing unions powers separation collection carrier x hx).1 nameX
42
- have ny := (M.realize_uniformNameFormula s pairing unions powers separation collection carrier y hy).1 nameY
43
- have eq := (M.realize_nameActionFormula a s t pairing unions powers separation collection carrier group maps
44
- g ⟨x, nx⟩ ⟨y, ny⟩ hx hy).1 action
45
- exact ⟨⟨⟨x, nx⟩, hx⟩, rfl, (congrArg Subtype.val eq).symm⟩
46
- · rintro ⟨σ, rfl, rfl⟩
47
- refine ⟨(M.realize_uniformNameFormula s pairing unions powers separation collection carrier _ hx).2 σ.val.property,
48
- (M.realize_uniformNameFormula s pairing unions powers separation collection carrier _ hy).2
49
- (a.act s g σ.val).property, ?_⟩
50
- exact (M.realize_nameActionFormula a s t pairing unions powers separation collection carrier group maps
51
- g σ.val (a.act s g σ.val) hx hy).2 rfl
52
-
53
- noncomputable def orbitParameters (W : ZFSet.{u}) : Fin 4 → ZFSet.{u} :=
54
- extend W (extend s.carrier (extend t.carrier (extend (a.conditionMapFamily s t) Fin.elim0)))
55
-
56
- theorem realize_orbitImageFormula
57
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
58
- (unions : Realize M.sets SetFormula.union Fin.elim0)
59
- (powers : Realize M.sets powerSet Fin.elim0)
60
- (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets)
61
- (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets)
62
- (maps : a.conditionMapFamily s t ∈ M.sets)
63
- (W z y : ZFSet.{u}) (hz : z ∈ M.sets) (hy : y ∈ M.sets) :
64
- Realize M.sets orbitImageFormula (extend z (extend y (orbitParameters a s t W))) ↔
65
- ∃ g, ∃ σ : (M.nameDomain s).names, σ.val.val ∈ W ∧
66
- z = ZFSet.pair (t.encode g) σ.val.val ∧ y = (a.act s g σ.val).val := by
67
- rw [orbitImageFormula, realize_ex]
68
- constructor
69
- · rintro ⟨x, hx, rest⟩
70
- obtain ⟨g, member, shape, action⟩ := (M.realize_exConditions t 5 _
71
- (extend x (extend z (extend y (orbitParameters a s t W)))) group rfl).1 rest
72
- rw [realize_atomicApplication, map_extend, map_extend, map_empty] at action
73
- obtain ⟨σ, eq, output⟩ := (M.realize_codedNameActionFormula a s t pairing unions powers separation collection
74
- carrier group maps g x y hx hy).1 action
75
- have raw := (M.realize_orderedPairFormula pairing 2 0 1
76
- (extend (t.encode g) (extend x (extend z (extend y (orbitParameters a s t W))))) hz
77
- (M.transitive group (t.encode_mem g)) hx).1 shape
78
- exact ⟨g, σ, eq.symm ▸ member, raw.trans (congrArg (ZFSet.pair (t.encode g)) eq.symm), output⟩
79
- · rintro ⟨g, σ, member, shape, output⟩
80
- refine ⟨σ.val.val, σ.property, ?_⟩
81
- apply (M.realize_exConditions t 5 _
82
- (extend σ.val.val (extend z (extend y (orbitParameters a s t W)))) group rfl).2
83
- refine ⟨g, member, ?_, ?_⟩
84
- · exact (M.realize_orderedPairFormula pairing 2 0 1
85
- (extend (t.encode g) (extend σ.val.val (extend z (extend y (orbitParameters a s t W))))) hz
86
- (M.transitive group (t.encode_mem g)) σ.property).2 shape
87
- · rw [realize_atomicApplication, map_extend, map_extend, map_empty]
88
- exact (M.realize_codedNameActionFormula a s t pairing unions powers separation collection
89
- carrier group maps g σ.val.val y σ.property hy).2 ⟨σ, rfl, output⟩
90
-
91
- end PartitionPilot.Forcing.TransitiveGround
92
-
93
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Geometry.GroundDefinableSelections
2
+
3
+ namespace OAI
4
+
5
+
6
+ namespace PartitionPilot.Forcing.SetFormula
7
+
8
+ def codedNameActionFormula : SetFormula 5 :=
9
+ .conj (domainApplication uniformNameFormula (extend 3 Fin.elim0) 1)
10
+ (.conj (domainApplication uniformNameFormula (extend 3 Fin.elim0) 2) nameActionFormula)
11
+
12
+ def orbitImageFormula : SetFormula 6 :=
13
+ ex (exConditions 5 (.conj (.mem 1 4) (.conj (orderedPairFormula 2 0 1)
14
+ (atomicApplication codedNameActionFormula (extend 5 (extend 7 Fin.elim0)) 0 1 3))))
15
+
16
+ end PartitionPilot.Forcing.SetFormula
17
+
18
+ namespace PartitionPilot.Forcing.TransitiveGround
19
+
20
+ open SetRealization SetFormula
21
+ universe u
22
+ variable (M : TransitiveGround.{u}) {G P : Type u} [Group G] [PartialOrder P]
23
+ variable (a : PosetAction G P) (s : Presentation P) (t : Presentation G)
24
+
25
+ theorem realize_codedNameActionFormula
26
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
27
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
28
+ (powers : Realize M.sets powerSet Fin.elim0)
29
+ (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets)
30
+ (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets)
31
+ (maps : a.conditionMapFamily s t ∈ M.sets)
32
+ (g : G) (x y : ZFSet.{u}) (hx : x ∈ M.sets) (hy : y ∈ M.sets) :
33
+ Realize M.sets codedNameActionFormula (extend (t.encode g) (extend x (extend y
34
+ (extend s.carrier (extend (a.conditionMapFamily s t) Fin.elim0))))) ↔
35
+ ∃ σ : (M.nameDomain s).names, σ.val.val = x ∧ y = (a.act s g σ.val).val := by
36
+ rw [codedNameActionFormula]
37
+ change (Realize M.sets _ _ ∧ Realize M.sets _ _ ∧ Realize M.sets _ _) ↔ _
38
+ simp only [realize_domainApplication, map_extend, map_empty]
39
+ constructor
40
+ · rintro ⟨nameX, nameY, action⟩
41
+ have nx := (M.realize_uniformNameFormula s pairing unions powers separation collection carrier x hx).1 nameX
42
+ have ny := (M.realize_uniformNameFormula s pairing unions powers separation collection carrier y hy).1 nameY
43
+ have eq := (M.realize_nameActionFormula a s t pairing unions powers separation collection carrier group maps
44
+ g ⟨x, nx⟩ ⟨y, ny⟩ hx hy).1 action
45
+ exact ⟨⟨⟨x, nx⟩, hx⟩, rfl, (congrArg Subtype.val eq).symm⟩
46
+ · rintro ⟨σ, rfl, rfl⟩
47
+ refine ⟨(M.realize_uniformNameFormula s pairing unions powers separation collection carrier _ hx).2 σ.val.property,
48
+ (M.realize_uniformNameFormula s pairing unions powers separation collection carrier _ hy).2
49
+ (a.act s g σ.val).property, ?_⟩
50
+ exact (M.realize_nameActionFormula a s t pairing unions powers separation collection carrier group maps
51
+ g σ.val (a.act s g σ.val) hx hy).2 rfl
52
+
53
+ noncomputable def orbitParameters (W : ZFSet.{u}) : Fin 4 → ZFSet.{u} :=
54
+ extend W (extend s.carrier (extend t.carrier (extend (a.conditionMapFamily s t) Fin.elim0)))
55
+
56
+ theorem realize_orbitImageFormula
57
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
58
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
59
+ (powers : Realize M.sets powerSet Fin.elim0)
60
+ (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets)
61
+ (carrier : s.carrier ∈ M.sets) (group : t.carrier ∈ M.sets)
62
+ (maps : a.conditionMapFamily s t ∈ M.sets)
63
+ (W z y : ZFSet.{u}) (hz : z ∈ M.sets) (hy : y ∈ M.sets) :
64
+ Realize M.sets orbitImageFormula (extend z (extend y (orbitParameters a s t W))) ↔
65
+ ∃ g, ∃ σ : (M.nameDomain s).names, σ.val.val ∈ W ∧
66
+ z = ZFSet.pair (t.encode g) σ.val.val ∧ y = (a.act s g σ.val).val := by
67
+ rw [orbitImageFormula, realize_ex]
68
+ constructor
69
+ · rintro ⟨x, hx, rest⟩
70
+ obtain ⟨g, member, shape, action⟩ := (M.realize_exConditions t 5 _
71
+ (extend x (extend z (extend y (orbitParameters a s t W)))) group rfl).1 rest
72
+ rw [realize_atomicApplication, map_extend, map_extend, map_empty] at action
73
+ obtain ⟨σ, eq, output⟩ := (M.realize_codedNameActionFormula a s t pairing unions powers separation collection
74
+ carrier group maps g x y hx hy).1 action
75
+ have raw := (M.realize_orderedPairFormula pairing 2 0 1
76
+ (extend (t.encode g) (extend x (extend z (extend y (orbitParameters a s t W))))) hz
77
+ (M.transitive group (t.encode_mem g)) hx).1 shape
78
+ exact ⟨g, σ, eq.symm ▸ member, raw.trans (congrArg (ZFSet.pair (t.encode g)) eq.symm), output⟩
79
+ · rintro ⟨g, σ, member, shape, output⟩
80
+ refine ⟨σ.val.val, σ.property, ?_⟩
81
+ apply (M.realize_exConditions t 5 _
82
+ (extend σ.val.val (extend z (extend y (orbitParameters a s t W)))) group rfl).2
83
+ refine ⟨g, member, ?_, ?_⟩
84
+ · exact (M.realize_orderedPairFormula pairing 2 0 1
85
+ (extend (t.encode g) (extend σ.val.val (extend z (extend y (orbitParameters a s t W))))) hz
86
+ (M.transitive group (t.encode_mem g)) σ.property).2 shape
87
+ · rw [realize_atomicApplication, map_extend, map_extend, map_empty]
88
+ exact (M.realize_codedNameActionFormula a s t pairing unions powers separation collection
89
+ carrier group maps g σ.val.val y σ.property hy).2 ⟨σ, rfl, output⟩
90
+
91
+ end PartitionPilot.Forcing.TransitiveGround
92
+
93
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/PairPushFilterFamilies.lean CHANGED
@@ -1,148 +1,148 @@
1
- import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFilterCopies
2
-
3
- namespace OAI
4
-
5
- namespace PartitionPilot.Forcing
6
-
7
- universe u
8
-
9
- noncomputable def pushFilterCode (L rL S F : ZFSet.{u}) : ZFSet.{u} :=
10
- ZFSet.sep (fun y => ∃ f ∈ F, ∃ z ∈ L,
11
- ZFSet.pair f z ∈ S ∧ ZFSet.pair z y ∈ rL) L
12
-
13
- theorem mem_pushFilterCode (L rL S F y : ZFSet.{u}) :
14
- y ∈ pushFilterCode L rL S F ↔ y ∈ L ∧ ∃ f ∈ F, ∃ z ∈ L,
15
- ZFSet.pair f z ∈ S ∧ ZFSet.pair z y ∈ rL := ZFSet.mem_sep
16
-
17
- theorem pushFilterCode_subset (L rL S F : ZFSet.{u}) : pushFilterCode L rL S F ⊆ L :=
18
- fun _ hy => ((mem_pushFilterCode L rL S F _).1 hy).1
19
-
20
- theorem MeetEmbeddingCode.order_iff {P L rP rL μP μL S x y x' y' : ZFSet.{u}}
21
- (embedding : MeetEmbeddingCode P L rP rL μP μL S)
22
- (source : MeetOrderCode P rP μP) (target : MeetOrderCode L rL μL)
23
- (first : ZFSet.pair x x' ∈ S) (second : ZFSet.pair y y' ∈ S) :
24
- ZFSet.pair x' y' ∈ rL ↔ ZFSet.pair x y ∈ rP := by
25
- refine ⟨?_, fun lower => embedding.monotone x y x' y' lower first second⟩
26
- intro lower
27
- have sx := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 first)
28
- have sy := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 second)
29
- obtain ⟨z, meetXY, _⟩ := source.operation.2 (ZFSet.pair x y)
30
- (ZFSet.pair_mem_prod.2 ⟨sx.1, sy.1⟩)
31
- have hz := (ZFSet.pair_mem_prod.1 (source.operation.1 meetXY)).2
32
- obtain ⟨z', image, _⟩ := embedding.injection.function.2 z hz
33
- have hz' := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 image)).2
34
- have imageMeet := embedding.map_meet x y z x' y' z' meetXY first second image
35
- have equalImage : z' = x' := target.order.antisymm z' hz' x' sx.2
36
- (target.lower_left x' y' z' imageMeet)
37
- (target.greatest x' y' z' x' sx.2 imageMeet (target.order.refl x' sx.2) lower)
38
- have equal : z = x := embedding.injection.injective z x x' (equalImage ▸ image) first
39
- exact equal ▸ source.lower_right x y z meetXY
40
-
41
- theorem meetFilter_pushFilter {P L rP rL μP μL S F : ZFSet.{u}}
42
- (source : MeetOrderCode P rP μP) (target : MeetOrderCode L rL μL)
43
- (embedding : MeetEmbeddingCode P L rP rL μP μL S)
44
- (filter : MeetFilterCode P rP μP F) :
45
- MeetFilterCode L rL μL (pushFilterCode L rL S F) where
46
- subset := pushFilterCode_subset L rL S F
47
- nonempty := by
48
- obtain ⟨f, hf⟩ := filter.nonempty
49
- obtain ⟨z, image, _⟩ := embedding.injection.function.2 f (filter.subset hf)
50
- have hz := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 image)).2
51
- exact ⟨z, (mem_pushFilterCode L rL S F z).2
52
- ⟨hz, f, hf, z, hz, image, target.order.refl z hz⟩⟩
53
- upward := by
54
- intro x hx y hy lower
55
- obtain ⟨hxL, f, hf, z, hz, image, below⟩ := (mem_pushFilterCode L rL S F x).1 hx
56
- exact (mem_pushFilterCode L rL S F y).2
57
- ⟨hy, f, hf, z, hz, image, target.order.trans z hz x hxL y hy below lower⟩
58
- closed_meet := by
59
- intro x hx y hy z meetXY
60
- obtain ⟨hxL, f, hf, f', hf', first, belowX⟩ := (mem_pushFilterCode L rL S F x).1 hx
61
- obtain ⟨hyL, g, hg, g', hg', second, belowY⟩ := (mem_pushFilterCode L rL S F y).1 hy
62
- have hz := (ZFSet.pair_mem_prod.1 (target.operation.1 meetXY)).2
63
- obtain ⟨h, meetFG, _⟩ := source.operation.2 (ZFSet.pair f g)
64
- (ZFSet.pair_mem_prod.2 ⟨filter.subset hf, filter.subset hg⟩)
65
- have hhF := filter.closed_meet f hf g hg h meetFG
66
- obtain ⟨h', image, _⟩ := embedding.injection.function.2 h (filter.subset hhF)
67
- have hh' := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 image)).2
68
- have imageMeet := embedding.map_meet f g h f' g' h' meetFG first second image
69
- have left := target.order.trans h' hh' f' hf' x hxL
70
- (target.lower_left f' g' h' imageMeet) belowX
71
- have right := target.order.trans h' hh' g' hg' y hyL
72
- (target.lower_right f' g' h' imageMeet) belowY
73
- exact (mem_pushFilterCode L rL S F z).2
74
- ⟨hz, h, hhF, h', hh', image, target.greatest x y z h' hh' meetXY left right⟩
75
-
76
- theorem pushFilter_trace {P L rP rL μP μL S F x y : ZFSet.{u}}
77
- (source : MeetOrderCode P rP μP) (target : MeetOrderCode L rL μL)
78
- (embedding : MeetEmbeddingCode P L rP rL μP μL S)
79
- (filter : MeetFilterCode P rP μP F) (entry : ZFSet.pair x y ∈ S) :
80
- y ∈ pushFilterCode L rL S F ↔ x ∈ F := by
81
- have shape := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 entry)
82
- constructor
83
- · intro positive
84
- obtain ⟨_, f, hf, z, _, image, below⟩ := (mem_pushFilterCode L rL S F y).1 positive
85
- exact filter.upward f hf x shape.1 ((embedding.order_iff source target image entry).1 below)
86
- · intro positive
87
- exact (mem_pushFilterCode L rL S F y).2
88
- ⟨shape.2, x, positive, y, shape.2, entry, target.order.refl y shape.2⟩
89
-
90
- theorem pushFilter_lower_bound {P L rP rL μP μL S F e e' y : ZFSet.{u}}
91
- (target : MeetOrderCode L rL μL) (embedding : MeetEmbeddingCode P L rP rL ��P μL S)
92
- (lower : ∀ f ∈ F, ZFSet.pair e f ∈ rP) (entry : ZFSet.pair e e' ∈ S)
93
- (positive : y ∈ pushFilterCode L rL S F) : ZFSet.pair e' y ∈ rL := by
94
- obtain ⟨hy, f, hf, z, hz, image, below⟩ := (mem_pushFilterCode L rL S F y).1 positive
95
- have he' := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 entry)).2
96
- exact target.order.trans e' he' z hz y hy
97
- (embedding.monotone e f e' z (lower f hf) entry image) below
98
-
99
- noncomputable def pairPushFilterFamily (K I J L rL Ss Fs B : ZFSet.{u}) : ZFSet.{u} :=
100
- ZFSet.sep (fun z => ∃ i ∈ I, ∃ j ∈ J, ∃ S ∈ Ss.sUnion.sUnion,
101
- ∃ F ∈ Fs.sUnion.sUnion, ∃ V ∈ B,
102
- z = ZFSet.pair (ZFSet.pair i j) V ∧ ZFSet.pair i S ∈ Ss ∧ ZFSet.pair j F ∈ Fs ∧
103
- V = pushFilterCode L rL S F) (ZFSet.prod K B)
104
-
105
- theorem pair_mem_pairPushFilterFamily (K I J L rL Ss Fs B i j V : ZFSet.{u}) :
106
- ZFSet.pair (ZFSet.pair i j) V ∈ pairPushFilterFamily K I J L rL Ss Fs B ↔
107
- ZFSet.pair i j ∈ K ∧ V ∈ B ∧ i ∈ I ∧ j ∈ J ∧ ∃ S F,
108
- ZFSet.pair i S ∈ Ss ∧ ZFSet.pair j F ∈ Fs ∧ V = pushFilterCode L rL S F := by
109
- rw [pairPushFilterFamily, ZFSet.mem_sep, ZFSet.pair_mem_prod]
110
- constructor
111
- · rintro ⟨⟨hk, hV⟩, i', hi, j', hj, S, _, F, _, V', _, equal, eS, eF, value⟩
112
- obtain ⟨pairEq, rfl⟩ := ZFSet.pair_inj.1 equal
113
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 pairEq
114
- exact ⟨hk, hV, hi, hj, S, F, eS, eF, value⟩
115
- · rintro ⟨hk, hV, hi, hj, S, F, eS, eF, value⟩
116
- exact ⟨⟨hk, hV⟩, i, hi, j, hj, S, pair_second_mem_doubleUnion eS,
117
- F, pair_second_mem_doubleUnion eF, V, hV, rfl, eS, eF, value⟩
118
-
119
- theorem pairPushFilterFamily_entry_iff {K I J L rL Ss Fs B i j S F V : ZFSet.{u}}
120
- (maps : FunctionGraphOn I Ss) (filters : FunctionGraphOn J Fs)
121
- (mapEntry : ZFSet.pair i S ∈ Ss) (filterEntry : ZFSet.pair j F ∈ Fs) :
122
- ZFSet.pair (ZFSet.pair i j) V ∈ pairPushFilterFamily K I J L rL Ss Fs B ↔
123
- ZFSet.pair i j ∈ K ∧ V ∈ B ∧ V = pushFilterCode L rL S F := by
124
- rw [pair_mem_pairPushFilterFamily]
125
- constructor
126
- · rintro ⟨hk, hV, _, _, S', F', eS, eF, value⟩
127
- exact ⟨hk, hV, maps.unique eS mapEntry ▸ filters.unique eF filterEntry ▸ value⟩
128
- · rintro ⟨hk, hV, value⟩
129
- exact ⟨hk, hV, maps.pair_source mapEntry, filters.pair_source filterEntry,
130
- S, F, mapEntry, filterEntry, value⟩
131
-
132
- theorem pairPushFilterFamily_function {K I J L rL Ss Fs B : ZFSet.{u}}
133
- (subset : K ⊆ ZFSet.prod I J) (maps : FunctionGraphOn I Ss) (filters : FunctionGraphOn J Fs)
134
- (bounds : ∀ i ∈ I, ∀ j ∈ J, ∀ S F,
135
- ZFSet.pair i S ∈ Ss → ZFSet.pair j F ∈ Fs → pushFilterCode L rL S F ∈ B) :
136
- ZFSet.IsFunc K B (pairPushFilterFamily K I J L rL Ss Fs B) := by
137
- refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩
138
- intro k hk
139
- obtain ⟨i, hi, j, hj, rfl⟩ := ZFSet.mem_prod.1 (subset hk)
140
- obtain ⟨S, eS⟩ := maps.total hi
141
- obtain ⟨F, eF⟩ := filters.total hj
142
- exact ⟨pushFilterCode L rL S F,
143
- (pairPushFilterFamily_entry_iff maps filters eS eF).2 ⟨hk, bounds i hi j hj S F eS eF, rfl⟩,
144
- fun V hV => ((pairPushFilterFamily_entry_iff maps filters eS eF).1 hV).2.2⟩
145
-
146
- end PartitionPilot.Forcing
147
-
148
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Forcing.GroundFilterCopies
2
+
3
+ namespace OAI
4
+
5
+ namespace PartitionPilot.Forcing
6
+
7
+ universe u
8
+
9
+ noncomputable def pushFilterCode (L rL S F : ZFSet.{u}) : ZFSet.{u} :=
10
+ ZFSet.sep (fun y => ∃ f ∈ F, ∃ z ∈ L,
11
+ ZFSet.pair f z ∈ S ∧ ZFSet.pair z y ∈ rL) L
12
+
13
+ theorem mem_pushFilterCode (L rL S F y : ZFSet.{u}) :
14
+ y ∈ pushFilterCode L rL S F ↔ y ∈ L ∧ ∃ f ∈ F, ∃ z ∈ L,
15
+ ZFSet.pair f z ∈ S ∧ ZFSet.pair z y ∈ rL := ZFSet.mem_sep
16
+
17
+ theorem pushFilterCode_subset (L rL S F : ZFSet.{u}) : pushFilterCode L rL S F ⊆ L :=
18
+ fun _ hy => ((mem_pushFilterCode L rL S F _).1 hy).1
19
+
20
+ theorem MeetEmbeddingCode.order_iff {P L rP rL μP μL S x y x' y' : ZFSet.{u}}
21
+ (embedding : MeetEmbeddingCode P L rP rL μP μL S)
22
+ (source : MeetOrderCode P rP μP) (target : MeetOrderCode L rL μL)
23
+ (first : ZFSet.pair x x' ∈ S) (second : ZFSet.pair y y' ∈ S) :
24
+ ZFSet.pair x' y' ∈ rL ↔ ZFSet.pair x y ∈ rP := by
25
+ refine ⟨?_, fun lower => embedding.monotone x y x' y' lower first second⟩
26
+ intro lower
27
+ have sx := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 first)
28
+ have sy := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 second)
29
+ obtain ⟨z, meetXY, _⟩ := source.operation.2 (ZFSet.pair x y)
30
+ (ZFSet.pair_mem_prod.2 ⟨sx.1, sy.1⟩)
31
+ have hz := (ZFSet.pair_mem_prod.1 (source.operation.1 meetXY)).2
32
+ obtain ⟨z', image, _⟩ := embedding.injection.function.2 z hz
33
+ have hz' := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 image)).2
34
+ have imageMeet := embedding.map_meet x y z x' y' z' meetXY first second image
35
+ have equalImage : z' = x' := target.order.antisymm z' hz' x' sx.2
36
+ (target.lower_left x' y' z' imageMeet)
37
+ (target.greatest x' y' z' x' sx.2 imageMeet (target.order.refl x' sx.2) lower)
38
+ have equal : z = x := embedding.injection.injective z x x' (equalImage ▸ image) first
39
+ exact equal ▸ source.lower_right x y z meetXY
40
+
41
+ theorem meetFilter_pushFilter {P L rP rL μP μL S F : ZFSet.{u}}
42
+ (source : MeetOrderCode P rP μP) (target : MeetOrderCode L rL μL)
43
+ (embedding : MeetEmbeddingCode P L rP rL μP μL S)
44
+ (filter : MeetFilterCode P rP μP F) :
45
+ MeetFilterCode L rL μL (pushFilterCode L rL S F) where
46
+ subset := pushFilterCode_subset L rL S F
47
+ nonempty := by
48
+ obtain ⟨f, hf⟩ := filter.nonempty
49
+ obtain ⟨z, image, _⟩ := embedding.injection.function.2 f (filter.subset hf)
50
+ have hz := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 image)).2
51
+ exact ⟨z, (mem_pushFilterCode L rL S F z).2
52
+ ⟨hz, f, hf, z, hz, image, target.order.refl z hz⟩⟩
53
+ upward := by
54
+ intro x hx y hy lower
55
+ obtain ⟨hxL, f, hf, z, hz, image, below⟩ := (mem_pushFilterCode L rL S F x).1 hx
56
+ exact (mem_pushFilterCode L rL S F y).2
57
+ ⟨hy, f, hf, z, hz, image, target.order.trans z hz x hxL y hy below lower⟩
58
+ closed_meet := by
59
+ intro x hx y hy z meetXY
60
+ obtain ⟨hxL, f, hf, f', hf', first, belowX⟩ := (mem_pushFilterCode L rL S F x).1 hx
61
+ obtain ⟨hyL, g, hg, g', hg', second, belowY⟩ := (mem_pushFilterCode L rL S F y).1 hy
62
+ have hz := (ZFSet.pair_mem_prod.1 (target.operation.1 meetXY)).2
63
+ obtain ⟨h, meetFG, _⟩ := source.operation.2 (ZFSet.pair f g)
64
+ (ZFSet.pair_mem_prod.2 ⟨filter.subset hf, filter.subset hg⟩)
65
+ have hhF := filter.closed_meet f hf g hg h meetFG
66
+ obtain ⟨h', image, _⟩ := embedding.injection.function.2 h (filter.subset hhF)
67
+ have hh' := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 image)).2
68
+ have imageMeet := embedding.map_meet f g h f' g' h' meetFG first second image
69
+ have left := target.order.trans h' hh' f' hf' x hxL
70
+ (target.lower_left f' g' h' imageMeet) belowX
71
+ have right := target.order.trans h' hh' g' hg' y hyL
72
+ (target.lower_right f' g' h' imageMeet) belowY
73
+ exact (mem_pushFilterCode L rL S F z).2
74
+ ⟨hz, h, hhF, h', hh', image, target.greatest x y z h' hh' meetXY left right⟩
75
+
76
+ theorem pushFilter_trace {P L rP rL μP μL S F x y : ZFSet.{u}}
77
+ (source : MeetOrderCode P rP μP) (target : MeetOrderCode L rL μL)
78
+ (embedding : MeetEmbeddingCode P L rP rL μP μL S)
79
+ (filter : MeetFilterCode P rP μP F) (entry : ZFSet.pair x y ∈ S) :
80
+ y ∈ pushFilterCode L rL S F ↔ x ∈ F := by
81
+ have shape := ZFSet.pair_mem_prod.1 (embedding.injection.function.1 entry)
82
+ constructor
83
+ · intro positive
84
+ obtain ⟨_, f, hf, z, _, image, below⟩ := (mem_pushFilterCode L rL S F y).1 positive
85
+ exact filter.upward f hf x shape.1 ((embedding.order_iff source target image entry).1 below)
86
+ · intro positive
87
+ exact (mem_pushFilterCode L rL S F y).2
88
+ ⟨shape.2, x, positive, y, shape.2, entry, target.order.refl y shape.2⟩
89
+
90
+ theorem pushFilter_lower_bound {P L rP rL μP μL S F e e' y : ZFSet.{u}}
91
+ (target : MeetOrderCode L rL μL) (embedding : MeetEmbeddingCode P L rP rL μP μL S)
92
+ (lower : ∀ f ∈ F, ZFSet.pair e f ∈ rP) (entry : ZFSet.pair e e' ∈ S)
93
+ (positive : y ∈ pushFilterCode L rL S F) : ZFSet.pair e' y ∈ rL := by
94
+ obtain ⟨hy, f, hf, z, hz, image, below⟩ := (mem_pushFilterCode L rL S F y).1 positive
95
+ have he' := (ZFSet.pair_mem_prod.1 (embedding.injection.function.1 entry)).2
96
+ exact target.order.trans e' he' z hz y hy
97
+ (embedding.monotone e f e' z (lower f hf) entry image) below
98
+
99
+ noncomputable def pairPushFilterFamily (K I J L rL Ss Fs B : ZFSet.{u}) : ZFSet.{u} :=
100
+ ZFSet.sep (fun z => ∃ i ∈ I, ∃ j ∈ J, ∃ S ∈ Ss.sUnion.sUnion,
101
+ ∃ F ∈ Fs.sUnion.sUnion, ∃ V ∈ B,
102
+ z = ZFSet.pair (ZFSet.pair i j) V ∧ ZFSet.pair i S ∈ Ss ∧ ZFSet.pair j F ∈ Fs ∧
103
+ V = pushFilterCode L rL S F) (ZFSet.prod K B)
104
+
105
+ theorem pair_mem_pairPushFilterFamily (K I J L rL Ss Fs B i j V : ZFSet.{u}) :
106
+ ZFSet.pair (ZFSet.pair i j) V ∈ pairPushFilterFamily K I J L rL Ss Fs B ↔
107
+ ZFSet.pair i j ∈ K ∧ V ∈ B ∧ i ∈ I ∧ j ∈ J ∧ ∃ S F,
108
+ ZFSet.pair i S ∈ Ss ∧ ZFSet.pair j F ∈ Fs ∧ V = pushFilterCode L rL S F := by
109
+ rw [pairPushFilterFamily, ZFSet.mem_sep, ZFSet.pair_mem_prod]
110
+ constructor
111
+ · rintro ⟨⟨hk, hV⟩, i', hi, j', hj, S, _, F, _, V', _, equal, eS, eF, value⟩
112
+ obtain ⟨pairEq, rfl⟩ := ZFSet.pair_inj.1 equal
113
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 pairEq
114
+ exact ⟨hk, hV, hi, hj, S, F, eS, eF, value⟩
115
+ · rintro ⟨hk, hV, hi, hj, S, F, eS, eF, value⟩
116
+ exact ⟨⟨hk, hV⟩, i, hi, j, hj, S, pair_second_mem_doubleUnion eS,
117
+ F, pair_second_mem_doubleUnion eF, V, hV, rfl, eS, eF, value⟩
118
+
119
+ theorem pairPushFilterFamily_entry_iff {K I J L rL Ss Fs B i j S F V : ZFSet.{u}}
120
+ (maps : FunctionGraphOn I Ss) (filters : FunctionGraphOn J Fs)
121
+ (mapEntry : ZFSet.pair i S ∈ Ss) (filterEntry : ZFSet.pair j F ∈ Fs) :
122
+ ZFSet.pair (ZFSet.pair i j) V ∈ pairPushFilterFamily K I J L rL Ss Fs B ↔
123
+ ZFSet.pair i j ∈ K ∧ V ∈ B ∧ V = pushFilterCode L rL S F := by
124
+ rw [pair_mem_pairPushFilterFamily]
125
+ constructor
126
+ · rintro ⟨hk, hV, _, _, S', F', eS, eF, value⟩
127
+ exact ⟨hk, hV, maps.unique eS mapEntry ▸ filters.unique eF filterEntry ▸ value⟩
128
+ · rintro ⟨hk, hV, value⟩
129
+ exact ⟨hk, hV, maps.pair_source mapEntry, filters.pair_source filterEntry,
130
+ S, F, mapEntry, filterEntry, value⟩
131
+
132
+ theorem pairPushFilterFamily_function {K I J L rL Ss Fs B : ZFSet.{u}}
133
+ (subset : K ⊆ ZFSet.prod I J) (maps : FunctionGraphOn I Ss) (filters : FunctionGraphOn J Fs)
134
+ (bounds : ∀ i ∈ I, ∀ j ∈ J, ∀ S F,
135
+ ZFSet.pair i S ∈ Ss → ZFSet.pair j F ∈ Fs → pushFilterCode L rL S F ∈ B) :
136
+ ZFSet.IsFunc K B (pairPushFilterFamily K I J L rL Ss Fs B) := by
137
+ refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩
138
+ intro k hk
139
+ obtain ⟨i, hi, j, hj, rfl⟩ := ZFSet.mem_prod.1 (subset hk)
140
+ obtain ⟨S, eS⟩ := maps.total hi
141
+ obtain ⟨F, eF⟩ := filters.total hj
142
+ exact ⟨pushFilterCode L rL S F,
143
+ (pairPushFilterFamily_entry_iff maps filters eS eF).2 ⟨hk, bounds i hi j hj S F eS eF, rfl⟩,
144
+ fun V hV => ((pairPushFilterFamily_entry_iff maps filters eS eF).1 hV).2.2⟩
145
+
146
+ end PartitionPilot.Forcing
147
+
148
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/ParentSupportCodes.lean CHANGED
@@ -1,632 +1,632 @@
1
- import OAI.SetTheory.PartitionPrinciple.Definability.GroundPairCompositions
2
-
3
- namespace OAI
4
-
5
-
6
- namespace PartitionPilot.Forcing.BoundedFormula
7
-
8
- open SetFormula
9
- universe u
10
-
11
- def orderedRightTripleFormula {n} (w x c q : Fin n) : BoundedFormula n :=
12
- exMem w (exMem 0 (.conj (orderedPairFormula 0 c.succ.succ q.succ.succ)
13
- (orderedPairFormula w.succ.succ x.succ.succ 0)))
14
-
15
- def rightTripleMembershipFormula {n} (x c q f : Fin n) : BoundedFormula n :=
16
- exMem f (orderedRightTripleFormula 0 x.succ c.succ q.succ)
17
-
18
- theorem truth_orderedRightTripleFormula {n} (w x c q : Fin n)
19
- (env : Fin n → ZFSet.{u}) :
20
- Truth (orderedRightTripleFormula w x c q) env ↔
21
- env w = ZFSet.pair (env x) (ZFSet.pair (env c) (env q)) := by
22
- simp only [orderedRightTripleFormula, truth_exMem, Truth, truth_orderedPairFormula]
23
- change (∃ a ∈ env w, ∃ b ∈ a, b = ZFSet.pair (env c) (env q) ∧
24
- env w = ZFSet.pair (env x) b) ↔ _
25
- constructor
26
- · rintro ⟨_, _, _, _, rfl, equal⟩
27
- exact equal
28
- · intro equal
29
- refine ⟨{env x, ZFSet.pair (env c) (env q)}, ?_, ZFSet.pair (env c) (env q),
30
- ZFSet.mem_pair.2 (Or.inr rfl), rfl, equal⟩
31
- rw [equal]
32
- exact ZFSet.mem_pair.2 (Or.inr rfl)
33
-
34
- theorem truth_rightTripleMembershipFormula {n} (x c q f : Fin n)
35
- (env : Fin n → ZFSet.{u}) :
36
- Truth (rightTripleMembershipFormula x c q f) env ↔
37
- ZFSet.pair (env x) (ZFSet.pair (env c) (env q)) ∈ env f := by
38
- simp only [rightTripleMembershipFormula, truth_exMem, truth_orderedRightTripleFormula]
39
- change (∃ w ∈ env f, w = ZFSet.pair (env x) (ZFSet.pair (env c) (env q))) ↔ _
40
- constructor
41
- · rintro ⟨w, hw, heq⟩
42
- exact heq ▸ hw
43
- · intro hw
44
- exact ⟨_, hw, rfl⟩
45
-
46
- def relationToProductFormula {n} (a c q f : Fin n) : BoundedFormula n :=
47
- .allMem f (exMem a.succ (exMem c.succ.succ
48
- (exMem q.succ.succ.succ (orderedRightTripleFormula 3 2 1 0))))
49
-
50
- def functionToProductFormula {n} (a c q f : Fin n) : BoundedFormula n :=
51
- .conj (relationToProductFormula a c q f)
52
- (.allMem a (exMem c.succ (exMem q.succ.succ
53
- (.conj (rightTripleMembershipFormula 2 1 0 f.succ.succ.succ)
54
- (.allMem c.succ.succ.succ (.allMem q.succ.succ.succ.succ
55
- (imp (rightTripleMembershipFormula 4 1 0 f.succ.succ.succ.succ.succ)
56
- (.conj (.equal 1 3) (.equal 0 2)))))))))
57
-
58
- theorem truth_relationToProductFormula {n} (a c q f : Fin n)
59
- (env : Fin n → ZFSet.{u}) :
60
- Truth (relationToProductFormula a c q f) env ↔
61
- env f ⊆ ZFSet.prod (env a) (ZFSet.prod (env c) (env q)) := by
62
- simp only [relationToProductFormula, Truth, truth_exMem, truth_orderedRightTripleFormula]
63
- constructor
64
- · intro h w hw
65
- obtain ⟨x, hx, d, hd, v, hv, equal⟩ := h w hw
66
- exact ZFSet.mem_prod.2 ⟨x, hx, ZFSet.pair d v, ZFSet.pair_mem_prod.2 ⟨hd, hv⟩, equal⟩
67
- · intro h w hw
68
- obtain ⟨x, hx, y, hy, equal⟩ := ZFSet.mem_prod.1 (h hw)
69
- obtain ⟨d, hd, v, hv, rfl⟩ := ZFSet.mem_prod.1 hy
70
- exact ⟨x, hx, d, hd, v, hv, equal⟩
71
-
72
- theorem truth_functionToProductFormula {n} (a c q f : Fin n)
73
- (env : Fin n → ZFSet.{u}) :
74
- Truth (functionToProductFormula a c q f) env ↔
75
- ZFSet.IsFunc (env a) (ZFSet.prod (env c) (env q)) (env f) := by
76
- simp only [functionToProductFormula, Truth, truth_relationToProductFormula, truth_exMem,
77
- truth_rightTripleMembershipFormula, truth_imp]
78
- constructor
79
- · rintro ⟨shape, total⟩
80
- refine ⟨shape, ?_⟩
81
- intro x hx
82
- obtain ⟨d, _, v, _, entry, unique⟩ := total x hx
83
- refine ⟨ZFSet.pair d v, entry, ?_⟩
84
- intro y hy
85
- obtain ⟨b, hb, z, hz, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (shape hy)).2
86
- have both : b = d ∧ z = v := unique b hb z hz hy
87
- obtain ⟨rfl, rfl⟩ := both
88
- rfl
89
- · rintro ⟨shape, total⟩
90
- refine ⟨shape, ?_⟩
91
- intro x hx
92
- obtain ⟨y, entry, unique⟩ := total x hx
93
- obtain ⟨d, hd, v, hv, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (shape entry)).2
94
- refine ⟨d, hd, v, hv, entry, ?_⟩
95
- intro b _ z _ hz
96
- exact ZFSet.pair_injective (unique _ hz)
97
-
98
- end PartitionPilot.Forcing.BoundedFormula
99
-
100
-
101
-
102
- namespace PartitionPilot.Forcing
103
-
104
- open scoped ZFSet
105
-
106
- universe u
107
-
108
- structure ChoiceFunctionCode (A f : ZFSet.{u}) : Prop where
109
- function : ZFSet.IsFunc A (⋃₀ A) f
110
- chosen : ∀ x y, ZFSet.pair x y ∈ f → y ∈ x
111
-
112
- namespace BoundedFormula
113
-
114
- open SetFormula
115
-
116
- theorem truth_nonemptyFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) :
117
- Truth (nonemptyFormula x) env ↔ (env x).Nonempty := by
118
- simp only [nonemptyFormula, truth_exMem, Truth]
119
- exact ⟨fun ⟨y, hy, _⟩ => ⟨y, hy⟩, fun ⟨y, hy⟩ => ⟨y, hy, True.intro⟩⟩
120
-
121
- theorem truth_choiceFunctionFormula {n} (a f : Fin n) (env : Fin n → ZFSet.{u}) :
122
- Truth (choiceFunctionFormula a f) env ↔ ChoiceFunctionCode (env a) (env f) := by
123
- simp only [choiceFunctionFormula, Truth, truth_exMem, truth_orderedPairFormula,
124
- truth_pairMembershipFormula, truth_imp]
125
- change ((∀ z ∈ env f, ∃ x ∈ env a, ∃ y ∈ x, z = ZFSet.pair x y) ∧
126
- ∀ x ∈ env a, ∃ y ∈ x, ZFSet.pair x y ∈ env f ∧
127
- ∀ z ∈ x, ZFSet.pair x z ∈ env f → z = y) ↔ _
128
- constructor
129
- · rintro ⟨shape, total⟩
130
- have chosen : ∀ x y, ZFSet.pair x y ∈ env f → y ∈ x := by
131
- intro x y rel
132
- obtain ⟨x', _, y', hy', eq⟩ := shape _ rel
133
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq
134
- exact hy'
135
- refine ⟨⟨?_, ?_⟩, chosen⟩
136
- · intro z hz
137
- obtain ⟨x, hx, y, hy, rfl⟩ := shape z hz
138
- exact ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.mem_sUnion.2 ⟨x, hx, hy⟩⟩
139
- · intro x hx
140
- obtain ⟨y, _, rel, unique⟩ := total x hx
141
- exact ⟨y, rel, fun z hz => unique z (chosen x z hz) hz⟩
142
- · intro h
143
- refine ⟨?_, ?_⟩
144
- · intro z hz
145
- obtain ⟨x, hx, y, _, eq⟩ := ZFSet.mem_prod.1 (h.function.1 hz)
146
- exact ⟨x, hx, y, h.chosen x y (eq ▸ hz), eq⟩
147
- · intro x hx
148
- obtain ⟨y, rel, unique⟩ := h.function.2 x hx
149
- exact ⟨y, h.chosen x y rel, rel, fun z _ hz => unique z hz⟩
150
-
151
- end BoundedFormula
152
-
153
-
154
- namespace TransitiveGround
155
-
156
- open SetFormula
157
- variable (M : TransitiveGround.{u})
158
-
159
- theorem choice_witness (choice : Realize M.sets SetFormula.choice Fin.elim0)
160
- {A : ZFSet.{u}} (hA : A ∈ M.sets) (nonempty : ∀ x ∈ A, x.Nonempty) :
161
- ∃ f ∈ M.sets, ChoiceFunctionCode A f := by
162
- have selected := (realize_imp M.sets _ _ _).1 (choice A hA)
163
- have premise : Realize M.sets
164
- (BoundedFormula.allMem 0 (BoundedFormula.nonemptyFormula 0)).toFormula (extend A Fin.elim0) := by
165
- apply (BoundedFormula.realize_toFormula M _ _ (Fin.cases hA (fun i => Fin.elim0 i))).2
166
- intro x hx
167
- exact (BoundedFormula.truth_nonemptyFormula 0 _).2 (nonempty x hx)
168
- obtain ⟨f, hf, rel⟩ := (realize_ex M.sets _ _).1 (selected premise)
169
- exact ⟨f, hf, (BoundedFormula.truth_choiceFunctionFormula 1 0 _).1
170
- ((BoundedFormula.realize_toFormula M _ _ (Fin.cases hf (Fin.cases hA (fun i => Fin.elim0 i)))).1 rel)⟩
171
-
172
- end TransitiveGround
173
-
174
- end PartitionPilot.Forcing
175
-
176
-
177
-
178
- namespace PartitionPilot.Forcing
179
-
180
- universe u
181
-
182
- noncomputable def relationFiber (B r x : ZFSet.{u}) : ZFSet.{u} :=
183
- ZFSet.sep (fun y => ZFSet.pair x y ∈ r) B
184
-
185
- theorem mem_relationFiber (B r x y : ZFSet.{u}) :
186
- y ∈ relationFiber B r x ↔ y ∈ B ∧ ZFSet.pair x y ∈ r := ZFSet.mem_sep
187
-
188
- noncomputable def choiceUniformGraph (A B r F c : ZFSet.{u}) : ZFSet.{u} :=
189
- ZFSet.sep (fun z => ∃ x ∈ A, ∃ y ∈ B, z = ZFSet.pair x y ∧
190
- relationFiber B r x ∈ F ∧ ZFSet.pair (relationFiber B r x) y ∈ c) (ZFSet.prod A B)
191
-
192
- theorem pair_mem_choiceUniformGraph (A B r F c x y : ZFSet.{u}) :
193
- ZFSet.pair x y ∈ choiceUniformGraph A B r F c ↔
194
- x ∈ A ∧ y ∈ B ∧ relationFiber B r x ∈ F ∧ ZFSet.pair (relationFiber B r x) y ∈ c := by
195
- rw [choiceUniformGraph, ZFSet.mem_sep]
196
- constructor
197
- · rintro ⟨_, a, ha, b, hb, eq, hf, rel⟩
198
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq
199
- exact ⟨ha, hb, hf, rel⟩
200
- · rintro ⟨hx, hy, hf, rel⟩
201
- exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, x, hx, y, hy, rfl, hf, rel⟩
202
-
203
- theorem choiceUniformGraph_function {A B r F c : ZFSet.{u}} (choice : ChoiceFunctionCode F c)
204
- (fibers : ∀ x ∈ A, relationFiber B r x ∈ F) :
205
- ZFSet.IsFunc A B (choiceUniformGraph A B r F c) ∧ choiceUniformGraph A B r F c ⊆ r := by
206
- refine ⟨⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩, ?_⟩
207
- · intro x hx
208
- obtain ⟨y, rel, unique⟩ := choice.function.2 (relationFiber B r x) (fibers x hx)
209
- have hy := (mem_relationFiber B r x y).1 (choice.chosen _ _ rel)
210
- exact ⟨y, (pair_mem_choiceUniformGraph A B r F c x y).2 ⟨hx, hy.1, fibers x hx, rel⟩,
211
- fun z hz => unique z ((pair_mem_choiceUniformGraph A B r F c x z).1 hz).2.2.2⟩
212
- · intro z hz
213
- obtain ⟨_, x, _, y, _, eq, _, rel⟩ := ZFSet.mem_sep.1 hz
214
- exact eq.symm ▸ ((mem_relationFiber B r x y).1 (choice.chosen _ _ rel)).2
215
-
216
- namespace BoundedFormula
217
-
218
- open SetFormula
219
-
220
- def fiberFormula {n} (f x b r : Fin n) : BoundedFormula n :=
221
- .conj (.allMem f (.mem 0 b.succ)) (.allMem b
222
- (.conj (imp (.mem 0 f.succ) (pairMembershipFormula x.succ 0 r.succ))
223
- (imp (pairMembershipFormula x.succ 0 r.succ) (.mem 0 f.succ))))
224
-
225
- theorem truth_fiberFormula {n} (f x b r : Fin n) (env : Fin n → ZFSet.{u}) :
226
- Truth (fiberFormula f x b r) env ↔ env f = relationFiber (env b) (env r) (env x) := by
227
- simp only [fiberFormula, Truth, truth_imp, truth_pairMembershipFormula]
228
- change ((∀ y ∈ env f, y ∈ env b) ∧ ∀ y ∈ env b,
229
- (y ∈ env f → ZFSet.pair (env x) y ∈ env r) ∧ (ZFSet.pair (env x) y ∈ env r → y ∈ env f)) ↔ _
230
- constructor
231
- · rintro ⟨subset, spec⟩
232
- apply ZFSet.ext
233
- intro y
234
- rw [mem_relationFiber]
235
- exact ⟨fun hy => ⟨subset y hy, (spec y (subset y hy)).1 hy⟩,
236
- fun ⟨hy, rel⟩ => (spec y hy).2 rel⟩
237
- · intro eq
238
- rw [eq]
239
- exact ⟨fun _ hy => (ZFSet.mem_sep.1 hy).1,
240
- fun y hy => ⟨fun rel => (ZFSet.mem_sep.1 rel).2, fun rel => ZFSet.mem_sep.2 ⟨hy, rel⟩⟩⟩
241
-
242
- def choiceUniformEntryFormula {n} (z a b r f c : Fin n) : BoundedFormula n :=
243
- exMem a (exMem b.succ (exMem f.succ.succ
244
- (.conj (orderedPairFormula z.succ.succ.succ 2 1)
245
- (.conj (fiberFormula 0 2 b.succ.succ.succ r.succ.succ.succ)
246
- (pairMembershipFormula 0 1 c.succ.succ.succ)))))
247
-
248
- theorem truth_choiceUniformEntryFormula {n} (z a b r f c : Fin n) (env : Fin n → ZFSet.{u}) :
249
- Truth (choiceUniformEntryFormula z a b r f c) env ↔
250
- ∃ x ∈ env a, ∃ y ∈ env b, env z = ZFSet.pair x y ∧
251
- relationFiber (env b) (env r) x ∈ env f ∧ ZFSet.pair (relationFiber (env b) (env r) x) y ∈ env c := by
252
- simp only [choiceUniformEntryFormula, truth_exMem, Truth,
253
- truth_orderedPairFormula, truth_fiberFormula, truth_pairMembershipFormula]
254
- change (∃ x ∈ env a, ∃ y ∈ env b, ∃ F ∈ env f, env z = ZFSet.pair x y ∧
255
- F = relationFiber (env b) (env r) x ∧ ZFSet.pair F y ∈ env c) ↔ _
256
- constructor
257
- · rintro ⟨x, hx, y, hy, F, hF, eq, rfl, rel⟩
258
- exact ⟨x, hx, y, hy, eq, hF, rel⟩
259
- · rintro ⟨x, hx, y, hy, eq, hF, rel⟩
260
- exact ⟨x, hx, y, hy, relationFiber (env b) (env r) x, hF, eq, rfl, rel⟩
261
-
262
- end BoundedFormula
263
-
264
- namespace TransitiveGround
265
-
266
- open SetFormula
267
- variable (M : TransitiveGround.{u})
268
-
269
- theorem relationFiber_mem (separation : SeparationSchema M.sets) {B r x : ZFSet.{u}}
270
- (hB : B ∈ M.sets) (hr : r ∈ M.sets) (hx : x ∈ M.sets) : relationFiber B r x ∈ M.sets := by
271
- let params := extend x (extend r Fin.elim0)
272
- have selected := M.bounded_separation_mem separation (BoundedFormula.pairMembershipFormula 1 0 2)
273
- params (Fin.cases hx (Fin.cases hr (fun i => Fin.elim0 i))) hB
274
- have eq : ZFSet.sep (fun y => BoundedFormula.Truth (BoundedFormula.pairMembershipFormula 1 0 2)
275
- (extend y params)) B = relationFiber B r x := by
276
- apply ZFSet.ext
277
- intro y
278
- rw [ZFSet.mem_sep, mem_relationFiber]
279
- exact and_congr Iff.rfl (BoundedFormula.truth_pairMembershipFormula 1 0 2 _)
280
- exact eq ▸ selected
281
-
282
- noncomputable def nonemptyGroundSubsets (B : ZFSet.{u}) : ZFSet.{u} :=
283
- ZFSet.sep ZFSet.Nonempty (M.groundPower B)
284
-
285
- theorem mem_nonemptyGroundSubsets (B F : ZFSet.{u}) :
286
- F ∈ M.nonemptyGroundSubsets B ↔ F ∈ M.sets ∧ F ⊆ B ∧ F.Nonempty := by
287
- rw [nonemptyGroundSubsets, ZFSet.mem_sep, M.mem_groundPower]
288
- exact and_assoc
289
-
290
- theorem nonemptyGroundSubsets_mem (powers : Realize M.sets powerSet Fin.elim0)
291
- (separation : SeparationSchema M.sets) {B : ZFSet.{u}} (hB : B ∈ M.sets) :
292
- M.nonemptyGroundSubsets B ∈ M.sets := by
293
- have selected := M.bounded_separation_mem separation (BoundedFormula.nonemptyFormula 0)
294
- Fin.elim0 (fun i => Fin.elim0 i) (M.groundPower_mem powers hB)
295
- have eq : ZFSet.sep (fun F => BoundedFormula.Truth (BoundedFormula.nonemptyFormula 0)
296
- (extend F Fin.elim0)) (M.groundPower B) = M.nonemptyGroundSubsets B := by
297
- apply ZFSet.ext
298
- intro F
299
- rw [ZFSet.mem_sep, nonemptyGroundSubsets, ZFSet.mem_sep]
300
- exact and_congr Iff.rfl (BoundedFormula.truth_nonemptyFormula 0 _)
301
- exact eq ▸ selected
302
-
303
- theorem choiceUniformGraph_mem
304
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
305
- (unions : Realize M.sets SetFormula.union Fin.elim0)
306
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
307
- {A B r F c : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets)
308
- (hr : r ∈ M.sets) (hF : F ∈ M.sets) (hc : c ∈ M.sets) : choiceUniformGraph A B r F c ∈ M.sets := by
309
- let params := extend A (extend B (extend r (extend F (extend c Fin.elim0))))
310
- have selected := M.bounded_separation_mem separation (BoundedFormula.choiceUniformEntryFormula 0 1 2 3 4 5)
311
- params (Fin.cases hA (Fin.cases hB (Fin.cases hr (Fin.cases hF (Fin.cases hc (fun i => Fin.elim0 i))))))
312
- (M.prod_mem pairing unions powers separation hA hB)
313
- have eq : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.choiceUniformEntryFormula 0 1 2 3 4 5)
314
- (extend z params)) (ZFSet.prod A B) = choiceUniformGraph A B r F c := by
315
- apply ZFSet.ext
316
- intro z
317
- rw [ZFSet.mem_sep, choiceUniformGraph, ZFSet.mem_sep]
318
- exact and_congr Iff.rfl (BoundedFormula.truth_choiceUniformEntryFormula 0 1 2 3 4 5 _)
319
- exact eq ▸ selected
320
-
321
- theorem uniformize_relation
322
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
323
- (unions : Realize M.sets SetFormula.union Fin.elim0)
324
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
325
- (choice : Realize M.sets SetFormula.choice Fin.elim0)
326
- {A B r : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hr : r ∈ M.sets)
327
- (total : ∀ x ∈ A, ∃ y ∈ B, ZFSet.pair x y ∈ r) :
328
- ∃ f ∈ M.sets, ZFSet.IsFunc A B f ∧ f ⊆ r := by
329
- have family := M.nonemptyGroundSubsets_mem powers separation hB
330
- obtain ⟨c, hc, code⟩ := M.choice_witness choice family
331
- (fun F hF => ((M.mem_nonemptyGroundSubsets B F).1 hF).2.2)
332
- have fibers (x : ZFSet.{u}) (hx : x ∈ A) : relationFiber B r x ∈ M.nonemptyGroundSubsets B := by
333
- obtain ⟨y, hy, rel⟩ := total x hx
334
- exact (M.mem_nonemptyGroundSubsets B _).2
335
- ⟨M.relationFiber_mem separation hB hr (M.transitive hA hx), fun _ hz => (ZFSet.mem_sep.1 hz).1,
336
- y, (mem_relationFiber B r x y).2 ⟨hy, rel⟩⟩
337
- exact ⟨choiceUniformGraph A B r (M.nonemptyGroundSubsets B) c,
338
- M.choiceUniformGraph_mem pairing unions powers separation hA hB hr family hc,
339
- choiceUniformGraph_function code fibers⟩
340
-
341
- end TransitiveGround
342
-
343
- end PartitionPilot.Forcing
344
-
345
-
346
-
347
- namespace PartitionPilot.Forcing
348
- open SetFormula
349
- universe u
350
-
351
- namespace BoundedFormula
352
- def relationFiberFamilyEntryFormula {n} (z I W B R : Fin n) : BoundedFormula n :=
353
- exMem I (exMem W.succ (.conj (orderedPairFormula z.succ.succ 1 0)
354
- (fiberFormula 0 1 B.succ.succ R.succ.succ)))
355
-
356
- theorem truth_relationFiberFamilyEntryFormula {n} (z I W B R : Fin n)
357
- (env : Fin n → ZFSet.{u}) :
358
- Truth (relationFiberFamilyEntryFormula z I W B R) env ↔
359
- ∃ i ∈ env I, ∃ f ∈ env W, env z = ZFSet.pair i f ∧
360
- f = relationFiber (env B) (env R) i := by
361
- simp only [relationFiberFamilyEntryFormula, truth_exMem, Truth,
362
- truth_orderedPairFormula, truth_fiberFormula]
363
- rfl
364
- end BoundedFormula
365
-
366
- namespace TransitiveGround
367
- variable (M : TransitiveGround.{u})
368
-
369
- noncomputable def relationFiberFamily (I B R : ZFSet.{u}) : ZFSet.{u} :=
370
- ZFSet.sep (fun z => ∃ i ∈ I, ∃ f ∈ M.groundPower B,
371
- z = ZFSet.pair i f ∧ f = relationFiber B R i) (ZFSet.prod I (M.groundPower B))
372
-
373
- theorem pair_mem_relationFiberFamily (I B R i f : ZFSet.{u}) :
374
- ZFSet.pair i f ∈ M.relationFiberFamily I B R ↔
375
- i ∈ I ∧ f ∈ M.groundPower B ∧ f = relationFiber B R i := by
376
- rw [relationFiberFamily, ZFSet.mem_sep, ZFSet.pair_mem_prod]
377
- constructor
378
- · rintro ⟨_, j, hj, g, hg, equal, value⟩
379
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
380
- exact ⟨hj, hg, value⟩
381
- · rintro ⟨hi, hf, equal⟩
382
- exact ⟨⟨hi, hf⟩, i, hi, f, hf, rfl, equal⟩
383
-
384
- variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
385
- variable (unions : Realize M.sets SetFormula.union Fin.elim0)
386
- variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
387
- variable {I B R : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets) (hR : R ∈ M.sets)
388
-
389
- include pairing unions powers separation hI hB hR in
390
- theorem relationFiberFamily_mem : M.relationFiberFamily I B R ∈ M.sets := by
391
- have hW := M.groundPower_mem powers hB
392
- let params := extend I (extend (M.groundPower B) (extend B (extend R Fin.elim0)))
393
- have selected := M.bounded_separation_mem separation
394
- (BoundedFormula.relationFiberFamilyEntryFormula 0 1 2 3 4) params
395
- (Fin.cases hI (Fin.cases hW (Fin.cases hB (Fin.cases hR (fun j => Fin.elim0 j)))))
396
- (M.prod_mem pairing unions powers separation hI hW)
397
- have equal : ZFSet.sep (fun z => BoundedFormula.Truth
398
- (BoundedFormula.relationFiberFamilyEntryFormula 0 1 2 3 4) (extend z params))
399
- (ZFSet.prod I (M.groundPower B)) = M.relationFiberFamily I B R := by
400
- apply ZFSet.ext
401
- intro z
402
- rw [ZFSet.mem_sep, relationFiberFamily, ZFSet.mem_sep]
403
- exact and_congr Iff.rfl (BoundedFormula.truth_relationFiberFamilyEntryFormula 0 1 2 3 4 _)
404
- exact equal ▸ selected
405
-
406
- include separation hI hB hR in
407
- theorem relationFiberFamily_function :
408
- ZFSet.IsFunc I (M.groundPower B) (M.relationFiberFamily I B R) := by
409
- refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩
410
- intro i hi
411
- have bound := (M.mem_groundPower B (relationFiber B R i)).2
412
- ⟨M.relationFiber_mem separation hB hR (M.transitive hI hi),
413
- fun _ hz => (mem_relationFiber _ _ _ _).1 hz |>.1⟩
414
- exact ⟨relationFiber B R i,
415
- (M.pair_mem_relationFiberFamily I B R i _).2 ⟨hi, bound, rfl⟩,
416
- fun f entry => ((M.pair_mem_relationFiberFamily I B R i f).1 entry).2.2⟩
417
-
418
- include separation hI hB hR in
419
- theorem relationFiberFamily_entries (i f : ZFSet.{u}) :
420
- ZFSet.pair i f ∈ M.relationFiberFamily I B R ↔ i ∈ I ∧ f = relationFiber B R i := by
421
- constructor
422
- · intro entry
423
- have parts := (M.pair_mem_relationFiberFamily I B R i f).1 entry
424
- exact ⟨parts.1, parts.2.2⟩
425
- · rintro ⟨hi, rfl⟩
426
- obtain ⟨f, entry, _⟩ := (M.relationFiberFamily_function separation hI hB hR).2 i hi
427
- have equal := ((M.pair_mem_relationFiberFamily I B R i f).1 entry).2.2
428
- exact equal ▸ entry
429
-
430
- end TransitiveGround
431
-
432
-
433
-
434
-
435
-
436
- def ExternalCosetSupport (E U C classifier copies zero v y : ZFSet.{u}) : Prop :=
437
- ∃ c ∈ C, ∃ w ∈ E, ∃ x ∈ U, v = ZFSet.pair zero c ∧
438
- ZFSet.pair w c ∈ classifier ∧ ZFSet.pair (ZFSet.pair w x) y ∈ copies
439
-
440
- def ExternalTileSupport (E Q Requests localPoints action first v y : ZFSet.{u}) : Prop :=
441
- ∃ w ∈ E, ∃ r ∈ Requests, ∃ x ∈ Q, v = ZFSet.pair first (ZFSet.pair w r) ∧
442
- ZFSet.pair r x ∈ localPoints ∧ ZFSet.pair (ZFSet.pair w x) y ∈ action
443
-
444
- def externalStarSupportGraph (V Q E U C Requests classifier copies localPoints action zero first : ZFSet.{u}) : ZFSet.{u} :=
445
- ZFSet.sep (fun z => ∃ v ∈ V, ∃ y ∈ Q, z = ZFSet.pair v y ∧
446
- (ExternalCosetSupport E U C classifier copies zero v y ∨
447
- ExternalTileSupport E Q Requests localPoints action first v y)) (ZFSet.prod V Q)
448
-
449
- theorem pair_mem_externalStarSupportGraph (V Q E U C Requests classifier copies localPoints action zero first v y : ZFSet.{u}) :
450
- ZFSet.pair v y ∈ externalStarSupportGraph V Q E U C Requests classifier copies localPoints action zero first ↔
451
- v ∈ V ∧ y ∈ Q ∧ (ExternalCosetSupport E U C classifier copies zero v y ∨
452
- ExternalTileSupport E Q Requests localPoints action first v y) := by
453
- rw [externalStarSupportGraph, ZFSet.mem_sep]
454
- constructor
455
- · rintro ⟨_, v', hv, y', hy, equal, body⟩
456
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
457
- exact ⟨hv, hy, body⟩
458
- · rintro ⟨hv, hy, body⟩
459
- exact ⟨ZFSet.pair_mem_prod.2 ⟨hv, hy⟩, v, hv, y, hy, rfl, body⟩
460
-
461
- namespace BoundedFormula
462
-
463
- def externalCosetSupportFormula {n} (E U C classifier copies zero v y : Fin n) : BoundedFormula n :=
464
- exMem C (exMem E.succ (exMem U.succ.succ
465
- (.conj (orderedPairFormula v.succ.succ.succ zero.succ.succ.succ 2)
466
- (.conj (pairMembershipFormula 1 2 classifier.succ.succ.succ)
467
- (tripleMembershipFormula 1 0 y.succ.succ.succ copies.succ.succ.succ)))))
468
-
469
- theorem truth_externalCosetSupportFormula {n} (E U C classifier copies zero v y : Fin n) (env : Fin n → ZFSet.{u}) :
470
- Truth (externalCosetSupportFormula E U C classifier copies zero v y) env ↔
471
- ExternalCosetSupport (env E) (env U) (env C) (env classifier) (env copies) (env zero) (env v) (env y) := by
472
- simp only [externalCosetSupportFormula, truth_exMem, Truth, truth_orderedPairFormula,
473
- truth_pairMembershipFormula, truth_tripleMembershipFormula, ExternalCosetSupport]
474
- rfl
475
-
476
- def externalTileSupportFormula {n} (E Q Requests localPoints action first v y : Fin n) : BoundedFormula n :=
477
- exMem E (exMem Requests.succ (exMem Q.succ.succ
478
- (.conj (orderedRightTripleFormula v.succ.succ.succ first.succ.succ.succ 2 1)
479
- (.conj (pairMembershipFormula 1 0 localPoints.succ.succ.succ)
480
- (tripleMembershipFormula 2 0 y.succ.succ.succ action.succ.succ.succ)))))
481
-
482
- theorem truth_externalTileSupportFormula {n} (E Q Requests localPoints action first v y : Fin n) (env : Fin n → ZFSet.{u}) :
483
- Truth (externalTileSupportFormula E Q Requests localPoints action first v y) env ↔
484
- ExternalTileSupport (env E) (env Q) (env Requests) (env localPoints) (env action) (env first) (env v) (env y) := by
485
- simp only [externalTileSupportFormula, truth_exMem, Truth, truth_orderedRightTripleFormula,
486
- truth_pairMembershipFormula, truth_tripleMembershipFormula, ExternalTileSupport]
487
- rfl
488
-
489
- def externalStarSupportEntryFormula {n} (z V Q E U C Requests classifier copies localPoints action zero first : Fin n) : BoundedFormula n :=
490
- exMem V (exMem Q.succ (.conj (orderedPairFormula z.succ.succ 1 0)
491
- (.disj (externalCosetSupportFormula E.succ.succ U.succ.succ C.succ.succ
492
- classifier.succ.succ copies.succ.succ zero.succ.succ 1 0)
493
- (externalTileSupportFormula E.succ.succ Q.succ.succ Requests.succ.succ
494
- localPoints.succ.succ action.succ.succ first.succ.succ 1 0))))
495
-
496
- theorem truth_externalStarSupportEntryFormula {n} (z V Q E U C Requests classifier copies localPoints action zero first : Fin n)
497
- (env : Fin n → ZFSet.{u}) :
498
- Truth (externalStarSupportEntryFormula z V Q E U C Requests classifier copies localPoints action zero first) env ↔
499
- env z ∈ externalStarSupportGraph (env V) (env Q) (env E) (env U) (env C) (env Requests)
500
- (env classifier) (env copies) (env localPoints) (env action) (env zero) (env first) := by
501
- simp only [externalStarSupportEntryFormula, truth_exMem, Truth, truth_disj, truth_orderedPairFormula,
502
- truth_externalCosetSupportFormula, truth_externalTileSupportFormula, externalStarSupportGraph, ZFSet.mem_sep]
503
- refine ⟨fun body => ⟨?_, body⟩, And.right⟩
504
- obtain ⟨v, hv, y, hy, equal, _⟩ := body
505
- change env z = ZFSet.pair v y at equal
506
- rw [equal]
507
- exact ZFSet.pair_mem_prod.2 ⟨hv, hy⟩
508
- end BoundedFormula
509
-
510
- namespace TransitiveGround
511
- variable (M : TransitiveGround.{u})
512
- theorem externalStarSupportGraph_mem
513
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
514
- (unions : Realize M.sets SetFormula.union Fin.elim0)
515
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
516
- {V Q E U C Requests classifier copies localPoints action zero first : ZFSet.{u}}
517
- (hV : V ∈ M.sets) (hQ : Q ∈ M.sets) (hE : E ∈ M.sets) (hU : U ∈ M.sets)
518
- (hC : C ∈ M.sets) (hRequests : Requests ∈ M.sets) (hClassifier : classifier ∈ M.sets)
519
- (hCopies : copies ∈ M.sets) (hLocal : localPoints ∈ M.sets) (hAction : action ∈ M.sets)
520
- (hZero : zero ∈ M.sets) (hFirst : first ∈ M.sets) :
521
- externalStarSupportGraph V Q E U C Requests classifier copies localPoints action zero first ∈ M.sets := by
522
- let params := extend V (extend Q (extend E (extend U (extend C (extend Requests (extend classifier (extend copies (extend localPoints (extend action (extend zero (extend first (Fin.elim0))))))))))))
523
- have members : ∀ i, params i ∈ M.sets := Fin.cases hV (Fin.cases hQ (Fin.cases hE (Fin.cases hU (Fin.cases hC (Fin.cases hRequests (Fin.cases hClassifier (Fin.cases hCopies (Fin.cases hLocal (Fin.cases hAction (Fin.cases hZero (Fin.cases hFirst ((fun i => Fin.elim0 i)))))))))))))
524
- have selected := M.bounded_separation_mem separation
525
- (BoundedFormula.externalStarSupportEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12) params members
526
- (M.prod_mem pairing unions powers separation hV hQ)
527
- have equal : ZFSet.sep (fun z => BoundedFormula.Truth
528
- (BoundedFormula.externalStarSupportEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12) (extend z params))
529
- (ZFSet.prod V Q) = externalStarSupportGraph V Q E U C Requests classifier copies localPoints action zero first := by
530
- apply ZFSet.ext
531
- intro z
532
- rw [ZFSet.mem_sep, BoundedFormula.truth_externalStarSupportEntryFormula]
533
- change (z ∈ ZFSet.prod V Q ∧ z ∈ externalStarSupportGraph V Q E U C Requests classifier copies localPoints action zero first) ↔ _
534
- exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩
535
- exact equal ▸ selected
536
-
537
- end TransitiveGround
538
-
539
-
540
-
541
-
542
-
543
- def parentSupportGraph (V Q supports parents : ZFSet.{u}) : ZFSet.{u} :=
544
- ZFSet.sep (fun z => ∃ v ∈ V, ∃ y ∈ Q, z = ZFSet.pair v y ∧ ZFSet.pair v y ∈ supports ∧
545
- ∃ p ∈ V, ZFSet.pair v p ∈ parents ∧ ZFSet.pair p y ∈ supports) (ZFSet.prod V Q)
546
-
547
- def freshSupportGraph (V Q supports parents : ZFSet.{u}) : ZFSet.{u} :=
548
- ZFSet.sep (fun z => z ∉ parentSupportGraph V Q supports parents) supports
549
-
550
- theorem pair_mem_parentSupportGraph (V Q supports parents v y : ZFSet.{u}) :
551
- ZFSet.pair v y ∈ parentSupportGraph V Q supports parents ↔ v ∈ V ∧ y ∈ Q ∧
552
- ZFSet.pair v y ∈ supports ∧ ∃ p ∈ V, ZFSet.pair v p ∈ parents ∧ ZFSet.pair p y ∈ supports := by
553
- rw [parentSupportGraph, ZFSet.mem_sep]
554
- constructor
555
- · rintro ⟨_, v', hv, y', hy, equal, body⟩
556
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
557
- exact ⟨hv, hy, body⟩
558
- · rintro ⟨hv, hy, body⟩
559
- exact ⟨ZFSet.pair_mem_prod.2 ⟨hv, hy⟩, v, hv, y, hy, rfl, body⟩
560
-
561
- theorem pair_mem_parentSupportGraph_of_parent {V Q supports parents v p y : ZFSet.{u}}
562
- (function : ZFSet.IsFunc V V parents) (parent : ZFSet.pair v p ∈ parents) :
563
- ZFSet.pair v y ∈ parentSupportGraph V Q supports parents ↔
564
- y ∈ Q ∧ ZFSet.pair v y ∈ supports ∧ ZFSet.pair p y ∈ supports := by
565
- have shape := ZFSet.pair_mem_prod.1 (function.1 parent)
566
- rw [pair_mem_parentSupportGraph]
567
- constructor
568
- · rintro ⟨_, hy, supported, p', _, atParent, supportedParent⟩
569
- have equal := (show FunctionGraphOn V parents from ⟨V, function⟩).unique atParent parent
570
- exact ⟨hy, supported, equal ▸ supportedParent⟩
571
- · rintro ⟨hy, supported, supportedParent⟩
572
- exact ⟨shape.1, hy, supported, p, shape.2, parent, supportedParent⟩
573
-
574
- theorem pair_mem_freshSupportGraph (V Q supports parents v y : ZFSet.{u}) :
575
- ZFSet.pair v y ∈ freshSupportGraph V Q supports parents ↔
576
- ZFSet.pair v y ∈ supports ∧ ZFSet.pair v y ∉ parentSupportGraph V Q supports parents := by
577
- exact ZFSet.mem_sep
578
-
579
- namespace BoundedFormula
580
- def parentSupportEntryFormula {n} (z V Q supports parents : Fin n) : BoundedFormula n :=
581
- exMem V (exMem Q.succ (.conj (orderedPairFormula z.succ.succ 1 0)
582
- (.conj (pairMembershipFormula 1 0 supports.succ.succ)
583
- (exMem V.succ.succ (.conj (pairMembershipFormula 2 0 parents.succ.succ.succ)
584
- (pairMembershipFormula 0 1 supports.succ.succ.succ))))))
585
-
586
- theorem truth_parentSupportEntryFormula {n} (z V Q supports parents : Fin n) (env : Fin n → ZFSet.{u}) :
587
- Truth (parentSupportEntryFormula z V Q supports parents) env ↔
588
- env z ∈ parentSupportGraph (env V) (env Q) (env supports) (env parents) := by
589
- simp only [parentSupportEntryFormula, truth_exMem, Truth, truth_orderedPairFormula,
590
- truth_pairMembershipFormula, parentSupportGraph, ZFSet.mem_sep]
591
- refine ⟨fun h => ⟨?_, h⟩, And.right⟩
592
- obtain ⟨v, hv, y, hy, equal, _⟩ := h
593
- change env z = ZFSet.pair v y at equal
594
- rw [equal]
595
- exact ZFSet.pair_mem_prod.2 ⟨hv, hy⟩
596
- end BoundedFormula
597
-
598
- namespace TransitiveGround
599
- variable (M : TransitiveGround.{u})
600
- variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
601
- variable (unions : Realize M.sets SetFormula.union Fin.elim0)
602
- variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
603
- variable {V Q supports parents : ZFSet.{u}} (hV : V ∈ M.sets) (hQ : Q ∈ M.sets)
604
- variable (hSupports : supports ∈ M.sets) (hParents : parents ∈ M.sets)
605
- include pairing unions powers separation hV hQ hSupports hParents
606
-
607
- theorem parentSupportGraph_mem : parentSupportGraph V Q supports parents ∈ M.sets := by
608
- let params := extend V (extend Q (extend supports (extend parents Fin.elim0)))
609
- have selected := M.bounded_separation_mem separation
610
- (BoundedFormula.parentSupportEntryFormula 0 1 2 3 4) params
611
- (Fin.cases hV (Fin.cases hQ (Fin.cases hSupports (Fin.cases hParents (fun i => Fin.elim0 i)))))
612
- (M.prod_mem pairing unions powers separation hV hQ)
613
- have equal : ZFSet.sep (fun z => BoundedFormula.Truth
614
- (BoundedFormula.parentSupportEntryFormula 0 1 2 3 4) (extend z params)) (ZFSet.prod V Q) =
615
- parentSupportGraph V Q supports parents := by
616
- apply ZFSet.ext
617
- intro z
618
- rw [ZFSet.mem_sep, BoundedFormula.truth_parentSupportEntryFormula]
619
- exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩
620
- exact equal ▸ selected
621
-
622
- theorem freshSupportGraph_mem : freshSupportGraph V Q supports parents ∈ M.sets := by
623
- have parentGround := M.parentSupportGraph_mem pairing unions powers separation hV hQ hSupports hParents
624
- exact M.bounded_separation_mem separation (BoundedFormula.neg (.mem 0 1))
625
- (extend (parentSupportGraph V Q supports parents) Fin.elim0)
626
- (Fin.cases parentGround (fun i => Fin.elim0 i)) hSupports
627
-
628
- end TransitiveGround
629
-
630
- end PartitionPilot.Forcing
631
-
632
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Definability.GroundPairCompositions
2
+
3
+ namespace OAI
4
+
5
+
6
+ namespace PartitionPilot.Forcing.BoundedFormula
7
+
8
+ open SetFormula
9
+ universe u
10
+
11
+ def orderedRightTripleFormula {n} (w x c q : Fin n) : BoundedFormula n :=
12
+ exMem w (exMem 0 (.conj (orderedPairFormula 0 c.succ.succ q.succ.succ)
13
+ (orderedPairFormula w.succ.succ x.succ.succ 0)))
14
+
15
+ def rightTripleMembershipFormula {n} (x c q f : Fin n) : BoundedFormula n :=
16
+ exMem f (orderedRightTripleFormula 0 x.succ c.succ q.succ)
17
+
18
+ theorem truth_orderedRightTripleFormula {n} (w x c q : Fin n)
19
+ (env : Fin n → ZFSet.{u}) :
20
+ Truth (orderedRightTripleFormula w x c q) env ↔
21
+ env w = ZFSet.pair (env x) (ZFSet.pair (env c) (env q)) := by
22
+ simp only [orderedRightTripleFormula, truth_exMem, Truth, truth_orderedPairFormula]
23
+ change (∃ a ∈ env w, ∃ b ∈ a, b = ZFSet.pair (env c) (env q) ∧
24
+ env w = ZFSet.pair (env x) b) ↔ _
25
+ constructor
26
+ · rintro ⟨_, _, _, _, rfl, equal⟩
27
+ exact equal
28
+ · intro equal
29
+ refine ⟨{env x, ZFSet.pair (env c) (env q)}, ?_, ZFSet.pair (env c) (env q),
30
+ ZFSet.mem_pair.2 (Or.inr rfl), rfl, equal⟩
31
+ rw [equal]
32
+ exact ZFSet.mem_pair.2 (Or.inr rfl)
33
+
34
+ theorem truth_rightTripleMembershipFormula {n} (x c q f : Fin n)
35
+ (env : Fin n → ZFSet.{u}) :
36
+ Truth (rightTripleMembershipFormula x c q f) env ↔
37
+ ZFSet.pair (env x) (ZFSet.pair (env c) (env q)) ∈ env f := by
38
+ simp only [rightTripleMembershipFormula, truth_exMem, truth_orderedRightTripleFormula]
39
+ change (∃ w ∈ env f, w = ZFSet.pair (env x) (ZFSet.pair (env c) (env q))) ↔ _
40
+ constructor
41
+ · rintro ⟨w, hw, heq⟩
42
+ exact heq ▸ hw
43
+ · intro hw
44
+ exact ⟨_, hw, rfl⟩
45
+
46
+ def relationToProductFormula {n} (a c q f : Fin n) : BoundedFormula n :=
47
+ .allMem f (exMem a.succ (exMem c.succ.succ
48
+ (exMem q.succ.succ.succ (orderedRightTripleFormula 3 2 1 0))))
49
+
50
+ def functionToProductFormula {n} (a c q f : Fin n) : BoundedFormula n :=
51
+ .conj (relationToProductFormula a c q f)
52
+ (.allMem a (exMem c.succ (exMem q.succ.succ
53
+ (.conj (rightTripleMembershipFormula 2 1 0 f.succ.succ.succ)
54
+ (.allMem c.succ.succ.succ (.allMem q.succ.succ.succ.succ
55
+ (imp (rightTripleMembershipFormula 4 1 0 f.succ.succ.succ.succ.succ)
56
+ (.conj (.equal 1 3) (.equal 0 2)))))))))
57
+
58
+ theorem truth_relationToProductFormula {n} (a c q f : Fin n)
59
+ (env : Fin n → ZFSet.{u}) :
60
+ Truth (relationToProductFormula a c q f) env ↔
61
+ env f ⊆ ZFSet.prod (env a) (ZFSet.prod (env c) (env q)) := by
62
+ simp only [relationToProductFormula, Truth, truth_exMem, truth_orderedRightTripleFormula]
63
+ constructor
64
+ · intro h w hw
65
+ obtain ⟨x, hx, d, hd, v, hv, equal⟩ := h w hw
66
+ exact ZFSet.mem_prod.2 ⟨x, hx, ZFSet.pair d v, ZFSet.pair_mem_prod.2 ⟨hd, hv⟩, equal⟩
67
+ · intro h w hw
68
+ obtain ⟨x, hx, y, hy, equal⟩ := ZFSet.mem_prod.1 (h hw)
69
+ obtain ⟨d, hd, v, hv, rfl⟩ := ZFSet.mem_prod.1 hy
70
+ exact ⟨x, hx, d, hd, v, hv, equal⟩
71
+
72
+ theorem truth_functionToProductFormula {n} (a c q f : Fin n)
73
+ (env : Fin n → ZFSet.{u}) :
74
+ Truth (functionToProductFormula a c q f) env ↔
75
+ ZFSet.IsFunc (env a) (ZFSet.prod (env c) (env q)) (env f) := by
76
+ simp only [functionToProductFormula, Truth, truth_relationToProductFormula, truth_exMem,
77
+ truth_rightTripleMembershipFormula, truth_imp]
78
+ constructor
79
+ · rintro ⟨shape, total⟩
80
+ refine ⟨shape, ?_⟩
81
+ intro x hx
82
+ obtain ⟨d, _, v, _, entry, unique⟩ := total x hx
83
+ refine ⟨ZFSet.pair d v, entry, ?_⟩
84
+ intro y hy
85
+ obtain ⟨b, hb, z, hz, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (shape hy)).2
86
+ have both : b = d ∧ z = v := unique b hb z hz hy
87
+ obtain ⟨rfl, rfl⟩ := both
88
+ rfl
89
+ · rintro ⟨shape, total⟩
90
+ refine ⟨shape, ?_⟩
91
+ intro x hx
92
+ obtain ⟨y, entry, unique⟩ := total x hx
93
+ obtain ⟨d, hd, v, hv, rfl⟩ := ZFSet.mem_prod.1 (ZFSet.pair_mem_prod.1 (shape entry)).2
94
+ refine ⟨d, hd, v, hv, entry, ?_⟩
95
+ intro b _ z _ hz
96
+ exact ZFSet.pair_injective (unique _ hz)
97
+
98
+ end PartitionPilot.Forcing.BoundedFormula
99
+
100
+
101
+
102
+ namespace PartitionPilot.Forcing
103
+
104
+ open scoped ZFSet
105
+
106
+ universe u
107
+
108
+ structure ChoiceFunctionCode (A f : ZFSet.{u}) : Prop where
109
+ function : ZFSet.IsFunc A (⋃₀ A) f
110
+ chosen : ∀ x y, ZFSet.pair x y ∈ f → y ∈ x
111
+
112
+ namespace BoundedFormula
113
+
114
+ open SetFormula
115
+
116
+ theorem truth_nonemptyFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) :
117
+ Truth (nonemptyFormula x) env ↔ (env x).Nonempty := by
118
+ simp only [nonemptyFormula, truth_exMem, Truth]
119
+ exact ⟨fun ⟨y, hy, _⟩ => ⟨y, hy⟩, fun ⟨y, hy⟩ => ⟨y, hy, True.intro⟩⟩
120
+
121
+ theorem truth_choiceFunctionFormula {n} (a f : Fin n) (env : Fin n → ZFSet.{u}) :
122
+ Truth (choiceFunctionFormula a f) env ↔ ChoiceFunctionCode (env a) (env f) := by
123
+ simp only [choiceFunctionFormula, Truth, truth_exMem, truth_orderedPairFormula,
124
+ truth_pairMembershipFormula, truth_imp]
125
+ change ((∀ z ∈ env f, ∃ x ∈ env a, ∃ y ∈ x, z = ZFSet.pair x y) ∧
126
+ ∀ x ∈ env a, ∃ y ∈ x, ZFSet.pair x y ∈ env f ∧
127
+ ∀ z ∈ x, ZFSet.pair x z ∈ env f → z = y) ↔ _
128
+ constructor
129
+ · rintro ⟨shape, total⟩
130
+ have chosen : ∀ x y, ZFSet.pair x y ∈ env f → y ∈ x := by
131
+ intro x y rel
132
+ obtain ⟨x', _, y', hy', eq⟩ := shape _ rel
133
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq
134
+ exact hy'
135
+ refine ⟨⟨?_, ?_⟩, chosen⟩
136
+ · intro z hz
137
+ obtain ⟨x, hx, y, hy, rfl⟩ := shape z hz
138
+ exact ZFSet.pair_mem_prod.2 ⟨hx, ZFSet.mem_sUnion.2 ⟨x, hx, hy⟩⟩
139
+ · intro x hx
140
+ obtain ⟨y, _, rel, unique⟩ := total x hx
141
+ exact ⟨y, rel, fun z hz => unique z (chosen x z hz) hz⟩
142
+ · intro h
143
+ refine ⟨?_, ?_⟩
144
+ · intro z hz
145
+ obtain ⟨x, hx, y, _, eq⟩ := ZFSet.mem_prod.1 (h.function.1 hz)
146
+ exact ⟨x, hx, y, h.chosen x y (eq ▸ hz), eq⟩
147
+ · intro x hx
148
+ obtain ⟨y, rel, unique⟩ := h.function.2 x hx
149
+ exact ⟨y, h.chosen x y rel, rel, fun z _ hz => unique z hz⟩
150
+
151
+ end BoundedFormula
152
+
153
+
154
+ namespace TransitiveGround
155
+
156
+ open SetFormula
157
+ variable (M : TransitiveGround.{u})
158
+
159
+ theorem choice_witness (choice : Realize M.sets SetFormula.choice Fin.elim0)
160
+ {A : ZFSet.{u}} (hA : A ∈ M.sets) (nonempty : ∀ x ∈ A, x.Nonempty) :
161
+ ∃ f ∈ M.sets, ChoiceFunctionCode A f := by
162
+ have selected := (realize_imp M.sets _ _ _).1 (choice A hA)
163
+ have premise : Realize M.sets
164
+ (BoundedFormula.allMem 0 (BoundedFormula.nonemptyFormula 0)).toFormula (extend A Fin.elim0) := by
165
+ apply (BoundedFormula.realize_toFormula M _ _ (Fin.cases hA (fun i => Fin.elim0 i))).2
166
+ intro x hx
167
+ exact (BoundedFormula.truth_nonemptyFormula 0 _).2 (nonempty x hx)
168
+ obtain ⟨f, hf, rel⟩ := (realize_ex M.sets _ _).1 (selected premise)
169
+ exact ⟨f, hf, (BoundedFormula.truth_choiceFunctionFormula 1 0 _).1
170
+ ((BoundedFormula.realize_toFormula M _ _ (Fin.cases hf (Fin.cases hA (fun i => Fin.elim0 i)))).1 rel)⟩
171
+
172
+ end TransitiveGround
173
+
174
+ end PartitionPilot.Forcing
175
+
176
+
177
+
178
+ namespace PartitionPilot.Forcing
179
+
180
+ universe u
181
+
182
+ noncomputable def relationFiber (B r x : ZFSet.{u}) : ZFSet.{u} :=
183
+ ZFSet.sep (fun y => ZFSet.pair x y ∈ r) B
184
+
185
+ theorem mem_relationFiber (B r x y : ZFSet.{u}) :
186
+ y ∈ relationFiber B r x ↔ y ∈ B ∧ ZFSet.pair x y ∈ r := ZFSet.mem_sep
187
+
188
+ noncomputable def choiceUniformGraph (A B r F c : ZFSet.{u}) : ZFSet.{u} :=
189
+ ZFSet.sep (fun z => ∃ x ∈ A, ∃ y ∈ B, z = ZFSet.pair x y ∧
190
+ relationFiber B r x ∈ F ∧ ZFSet.pair (relationFiber B r x) y ∈ c) (ZFSet.prod A B)
191
+
192
+ theorem pair_mem_choiceUniformGraph (A B r F c x y : ZFSet.{u}) :
193
+ ZFSet.pair x y ∈ choiceUniformGraph A B r F c ↔
194
+ x ∈ A ∧ y ∈ B ∧ relationFiber B r x ∈ F ∧ ZFSet.pair (relationFiber B r x) y ∈ c := by
195
+ rw [choiceUniformGraph, ZFSet.mem_sep]
196
+ constructor
197
+ · rintro ⟨_, a, ha, b, hb, eq, hf, rel⟩
198
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 eq
199
+ exact ⟨ha, hb, hf, rel⟩
200
+ · rintro ⟨hx, hy, hf, rel⟩
201
+ exact ⟨ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, x, hx, y, hy, rfl, hf, rel⟩
202
+
203
+ theorem choiceUniformGraph_function {A B r F c : ZFSet.{u}} (choice : ChoiceFunctionCode F c)
204
+ (fibers : ∀ x ∈ A, relationFiber B r x ∈ F) :
205
+ ZFSet.IsFunc A B (choiceUniformGraph A B r F c) ∧ choiceUniformGraph A B r F c ⊆ r := by
206
+ refine ⟨⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩, ?_⟩
207
+ · intro x hx
208
+ obtain ⟨y, rel, unique⟩ := choice.function.2 (relationFiber B r x) (fibers x hx)
209
+ have hy := (mem_relationFiber B r x y).1 (choice.chosen _ _ rel)
210
+ exact ⟨y, (pair_mem_choiceUniformGraph A B r F c x y).2 ⟨hx, hy.1, fibers x hx, rel⟩,
211
+ fun z hz => unique z ((pair_mem_choiceUniformGraph A B r F c x z).1 hz).2.2.2⟩
212
+ · intro z hz
213
+ obtain ⟨_, x, _, y, _, eq, _, rel⟩ := ZFSet.mem_sep.1 hz
214
+ exact eq.symm ▸ ((mem_relationFiber B r x y).1 (choice.chosen _ _ rel)).2
215
+
216
+ namespace BoundedFormula
217
+
218
+ open SetFormula
219
+
220
+ def fiberFormula {n} (f x b r : Fin n) : BoundedFormula n :=
221
+ .conj (.allMem f (.mem 0 b.succ)) (.allMem b
222
+ (.conj (imp (.mem 0 f.succ) (pairMembershipFormula x.succ 0 r.succ))
223
+ (imp (pairMembershipFormula x.succ 0 r.succ) (.mem 0 f.succ))))
224
+
225
+ theorem truth_fiberFormula {n} (f x b r : Fin n) (env : Fin n → ZFSet.{u}) :
226
+ Truth (fiberFormula f x b r) env ↔ env f = relationFiber (env b) (env r) (env x) := by
227
+ simp only [fiberFormula, Truth, truth_imp, truth_pairMembershipFormula]
228
+ change ((∀ y ∈ env f, y ∈ env b) ∧ ∀ y ∈ env b,
229
+ (y ∈ env f → ZFSet.pair (env x) y ∈ env r) ∧ (ZFSet.pair (env x) y ∈ env r → y ∈ env f)) ↔ _
230
+ constructor
231
+ · rintro ⟨subset, spec⟩
232
+ apply ZFSet.ext
233
+ intro y
234
+ rw [mem_relationFiber]
235
+ exact ⟨fun hy => ⟨subset y hy, (spec y (subset y hy)).1 hy⟩,
236
+ fun ⟨hy, rel⟩ => (spec y hy).2 rel⟩
237
+ · intro eq
238
+ rw [eq]
239
+ exact ⟨fun _ hy => (ZFSet.mem_sep.1 hy).1,
240
+ fun y hy => ⟨fun rel => (ZFSet.mem_sep.1 rel).2, fun rel => ZFSet.mem_sep.2 ⟨hy, rel⟩⟩⟩
241
+
242
+ def choiceUniformEntryFormula {n} (z a b r f c : Fin n) : BoundedFormula n :=
243
+ exMem a (exMem b.succ (exMem f.succ.succ
244
+ (.conj (orderedPairFormula z.succ.succ.succ 2 1)
245
+ (.conj (fiberFormula 0 2 b.succ.succ.succ r.succ.succ.succ)
246
+ (pairMembershipFormula 0 1 c.succ.succ.succ)))))
247
+
248
+ theorem truth_choiceUniformEntryFormula {n} (z a b r f c : Fin n) (env : Fin n → ZFSet.{u}) :
249
+ Truth (choiceUniformEntryFormula z a b r f c) env ↔
250
+ ∃ x ∈ env a, ∃ y ∈ env b, env z = ZFSet.pair x y ∧
251
+ relationFiber (env b) (env r) x ∈ env f ∧ ZFSet.pair (relationFiber (env b) (env r) x) y ∈ env c := by
252
+ simp only [choiceUniformEntryFormula, truth_exMem, Truth,
253
+ truth_orderedPairFormula, truth_fiberFormula, truth_pairMembershipFormula]
254
+ change (∃ x ∈ env a, ∃ y ∈ env b, ∃ F ∈ env f, env z = ZFSet.pair x y ∧
255
+ F = relationFiber (env b) (env r) x ∧ ZFSet.pair F y ∈ env c) ↔ _
256
+ constructor
257
+ · rintro ⟨x, hx, y, hy, F, hF, eq, rfl, rel⟩
258
+ exact ⟨x, hx, y, hy, eq, hF, rel⟩
259
+ · rintro ⟨x, hx, y, hy, eq, hF, rel⟩
260
+ exact ⟨x, hx, y, hy, relationFiber (env b) (env r) x, hF, eq, rfl, rel⟩
261
+
262
+ end BoundedFormula
263
+
264
+ namespace TransitiveGround
265
+
266
+ open SetFormula
267
+ variable (M : TransitiveGround.{u})
268
+
269
+ theorem relationFiber_mem (separation : SeparationSchema M.sets) {B r x : ZFSet.{u}}
270
+ (hB : B ∈ M.sets) (hr : r ∈ M.sets) (hx : x ∈ M.sets) : relationFiber B r x ∈ M.sets := by
271
+ let params := extend x (extend r Fin.elim0)
272
+ have selected := M.bounded_separation_mem separation (BoundedFormula.pairMembershipFormula 1 0 2)
273
+ params (Fin.cases hx (Fin.cases hr (fun i => Fin.elim0 i))) hB
274
+ have eq : ZFSet.sep (fun y => BoundedFormula.Truth (BoundedFormula.pairMembershipFormula 1 0 2)
275
+ (extend y params)) B = relationFiber B r x := by
276
+ apply ZFSet.ext
277
+ intro y
278
+ rw [ZFSet.mem_sep, mem_relationFiber]
279
+ exact and_congr Iff.rfl (BoundedFormula.truth_pairMembershipFormula 1 0 2 _)
280
+ exact eq ▸ selected
281
+
282
+ noncomputable def nonemptyGroundSubsets (B : ZFSet.{u}) : ZFSet.{u} :=
283
+ ZFSet.sep ZFSet.Nonempty (M.groundPower B)
284
+
285
+ theorem mem_nonemptyGroundSubsets (B F : ZFSet.{u}) :
286
+ F ∈ M.nonemptyGroundSubsets B ↔ F ∈ M.sets ∧ F ⊆ B ∧ F.Nonempty := by
287
+ rw [nonemptyGroundSubsets, ZFSet.mem_sep, M.mem_groundPower]
288
+ exact and_assoc
289
+
290
+ theorem nonemptyGroundSubsets_mem (powers : Realize M.sets powerSet Fin.elim0)
291
+ (separation : SeparationSchema M.sets) {B : ZFSet.{u}} (hB : B ∈ M.sets) :
292
+ M.nonemptyGroundSubsets B ∈ M.sets := by
293
+ have selected := M.bounded_separation_mem separation (BoundedFormula.nonemptyFormula 0)
294
+ Fin.elim0 (fun i => Fin.elim0 i) (M.groundPower_mem powers hB)
295
+ have eq : ZFSet.sep (fun F => BoundedFormula.Truth (BoundedFormula.nonemptyFormula 0)
296
+ (extend F Fin.elim0)) (M.groundPower B) = M.nonemptyGroundSubsets B := by
297
+ apply ZFSet.ext
298
+ intro F
299
+ rw [ZFSet.mem_sep, nonemptyGroundSubsets, ZFSet.mem_sep]
300
+ exact and_congr Iff.rfl (BoundedFormula.truth_nonemptyFormula 0 _)
301
+ exact eq ▸ selected
302
+
303
+ theorem choiceUniformGraph_mem
304
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
305
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
306
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
307
+ {A B r F c : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets)
308
+ (hr : r ∈ M.sets) (hF : F ∈ M.sets) (hc : c ∈ M.sets) : choiceUniformGraph A B r F c ∈ M.sets := by
309
+ let params := extend A (extend B (extend r (extend F (extend c Fin.elim0))))
310
+ have selected := M.bounded_separation_mem separation (BoundedFormula.choiceUniformEntryFormula 0 1 2 3 4 5)
311
+ params (Fin.cases hA (Fin.cases hB (Fin.cases hr (Fin.cases hF (Fin.cases hc (fun i => Fin.elim0 i))))))
312
+ (M.prod_mem pairing unions powers separation hA hB)
313
+ have eq : ZFSet.sep (fun z => BoundedFormula.Truth (BoundedFormula.choiceUniformEntryFormula 0 1 2 3 4 5)
314
+ (extend z params)) (ZFSet.prod A B) = choiceUniformGraph A B r F c := by
315
+ apply ZFSet.ext
316
+ intro z
317
+ rw [ZFSet.mem_sep, choiceUniformGraph, ZFSet.mem_sep]
318
+ exact and_congr Iff.rfl (BoundedFormula.truth_choiceUniformEntryFormula 0 1 2 3 4 5 _)
319
+ exact eq ▸ selected
320
+
321
+ theorem uniformize_relation
322
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
323
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
324
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
325
+ (choice : Realize M.sets SetFormula.choice Fin.elim0)
326
+ {A B r : ZFSet.{u}} (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hr : r ∈ M.sets)
327
+ (total : ∀ x ∈ A, ∃ y ∈ B, ZFSet.pair x y ∈ r) :
328
+ ∃ f ∈ M.sets, ZFSet.IsFunc A B f ∧ f ⊆ r := by
329
+ have family := M.nonemptyGroundSubsets_mem powers separation hB
330
+ obtain ⟨c, hc, code⟩ := M.choice_witness choice family
331
+ (fun F hF => ((M.mem_nonemptyGroundSubsets B F).1 hF).2.2)
332
+ have fibers (x : ZFSet.{u}) (hx : x ∈ A) : relationFiber B r x ∈ M.nonemptyGroundSubsets B := by
333
+ obtain ⟨y, hy, rel⟩ := total x hx
334
+ exact (M.mem_nonemptyGroundSubsets B _).2
335
+ ⟨M.relationFiber_mem separation hB hr (M.transitive hA hx), fun _ hz => (ZFSet.mem_sep.1 hz).1,
336
+ y, (mem_relationFiber B r x y).2 ⟨hy, rel⟩⟩
337
+ exact ⟨choiceUniformGraph A B r (M.nonemptyGroundSubsets B) c,
338
+ M.choiceUniformGraph_mem pairing unions powers separation hA hB hr family hc,
339
+ choiceUniformGraph_function code fibers⟩
340
+
341
+ end TransitiveGround
342
+
343
+ end PartitionPilot.Forcing
344
+
345
+
346
+
347
+ namespace PartitionPilot.Forcing
348
+ open SetFormula
349
+ universe u
350
+
351
+ namespace BoundedFormula
352
+ def relationFiberFamilyEntryFormula {n} (z I W B R : Fin n) : BoundedFormula n :=
353
+ exMem I (exMem W.succ (.conj (orderedPairFormula z.succ.succ 1 0)
354
+ (fiberFormula 0 1 B.succ.succ R.succ.succ)))
355
+
356
+ theorem truth_relationFiberFamilyEntryFormula {n} (z I W B R : Fin n)
357
+ (env : Fin n → ZFSet.{u}) :
358
+ Truth (relationFiberFamilyEntryFormula z I W B R) env ↔
359
+ ∃ i ∈ env I, ∃ f ∈ env W, env z = ZFSet.pair i f ∧
360
+ f = relationFiber (env B) (env R) i := by
361
+ simp only [relationFiberFamilyEntryFormula, truth_exMem, Truth,
362
+ truth_orderedPairFormula, truth_fiberFormula]
363
+ rfl
364
+ end BoundedFormula
365
+
366
+ namespace TransitiveGround
367
+ variable (M : TransitiveGround.{u})
368
+
369
+ noncomputable def relationFiberFamily (I B R : ZFSet.{u}) : ZFSet.{u} :=
370
+ ZFSet.sep (fun z => ∃ i ∈ I, ∃ f ∈ M.groundPower B,
371
+ z = ZFSet.pair i f ∧ f = relationFiber B R i) (ZFSet.prod I (M.groundPower B))
372
+
373
+ theorem pair_mem_relationFiberFamily (I B R i f : ZFSet.{u}) :
374
+ ZFSet.pair i f ∈ M.relationFiberFamily I B R ↔
375
+ i ∈ I ∧ f ∈ M.groundPower B ∧ f = relationFiber B R i := by
376
+ rw [relationFiberFamily, ZFSet.mem_sep, ZFSet.pair_mem_prod]
377
+ constructor
378
+ · rintro ⟨_, j, hj, g, hg, equal, value⟩
379
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
380
+ exact ⟨hj, hg, value⟩
381
+ · rintro ⟨hi, hf, equal⟩
382
+ exact ⟨⟨hi, hf⟩, i, hi, f, hf, rfl, equal⟩
383
+
384
+ variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
385
+ variable (unions : Realize M.sets SetFormula.union Fin.elim0)
386
+ variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
387
+ variable {I B R : ZFSet.{u}} (hI : I ∈ M.sets) (hB : B ∈ M.sets) (hR : R ∈ M.sets)
388
+
389
+ include pairing unions powers separation hI hB hR in
390
+ theorem relationFiberFamily_mem : M.relationFiberFamily I B R ∈ M.sets := by
391
+ have hW := M.groundPower_mem powers hB
392
+ let params := extend I (extend (M.groundPower B) (extend B (extend R Fin.elim0)))
393
+ have selected := M.bounded_separation_mem separation
394
+ (BoundedFormula.relationFiberFamilyEntryFormula 0 1 2 3 4) params
395
+ (Fin.cases hI (Fin.cases hW (Fin.cases hB (Fin.cases hR (fun j => Fin.elim0 j)))))
396
+ (M.prod_mem pairing unions powers separation hI hW)
397
+ have equal : ZFSet.sep (fun z => BoundedFormula.Truth
398
+ (BoundedFormula.relationFiberFamilyEntryFormula 0 1 2 3 4) (extend z params))
399
+ (ZFSet.prod I (M.groundPower B)) = M.relationFiberFamily I B R := by
400
+ apply ZFSet.ext
401
+ intro z
402
+ rw [ZFSet.mem_sep, relationFiberFamily, ZFSet.mem_sep]
403
+ exact and_congr Iff.rfl (BoundedFormula.truth_relationFiberFamilyEntryFormula 0 1 2 3 4 _)
404
+ exact equal ▸ selected
405
+
406
+ include separation hI hB hR in
407
+ theorem relationFiberFamily_function :
408
+ ZFSet.IsFunc I (M.groundPower B) (M.relationFiberFamily I B R) := by
409
+ refine ⟨fun _ hz => (ZFSet.mem_sep.1 hz).1, ?_⟩
410
+ intro i hi
411
+ have bound := (M.mem_groundPower B (relationFiber B R i)).2
412
+ ⟨M.relationFiber_mem separation hB hR (M.transitive hI hi),
413
+ fun _ hz => (mem_relationFiber _ _ _ _).1 hz |>.1⟩
414
+ exact ⟨relationFiber B R i,
415
+ (M.pair_mem_relationFiberFamily I B R i _).2 ⟨hi, bound, rfl⟩,
416
+ fun f entry => ((M.pair_mem_relationFiberFamily I B R i f).1 entry).2.2⟩
417
+
418
+ include separation hI hB hR in
419
+ theorem relationFiberFamily_entries (i f : ZFSet.{u}) :
420
+ ZFSet.pair i f ∈ M.relationFiberFamily I B R ↔ i ∈ I ∧ f = relationFiber B R i := by
421
+ constructor
422
+ · intro entry
423
+ have parts := (M.pair_mem_relationFiberFamily I B R i f).1 entry
424
+ exact ⟨parts.1, parts.2.2⟩
425
+ · rintro ⟨hi, rfl⟩
426
+ obtain ⟨f, entry, _⟩ := (M.relationFiberFamily_function separation hI hB hR).2 i hi
427
+ have equal := ((M.pair_mem_relationFiberFamily I B R i f).1 entry).2.2
428
+ exact equal ▸ entry
429
+
430
+ end TransitiveGround
431
+
432
+
433
+
434
+
435
+
436
+ def ExternalCosetSupport (E U C classifier copies zero v y : ZFSet.{u}) : Prop :=
437
+ ∃ c ∈ C, ∃ w ∈ E, ∃ x ∈ U, v = ZFSet.pair zero c ∧
438
+ ZFSet.pair w c ∈ classifier ∧ ZFSet.pair (ZFSet.pair w x) y ∈ copies
439
+
440
+ def ExternalTileSupport (E Q Requests localPoints action first v y : ZFSet.{u}) : Prop :=
441
+ ∃ w ∈ E, ∃ r ∈ Requests, ∃ x ∈ Q, v = ZFSet.pair first (ZFSet.pair w r) ∧
442
+ ZFSet.pair r x ∈ localPoints ∧ ZFSet.pair (ZFSet.pair w x) y ∈ action
443
+
444
+ def externalStarSupportGraph (V Q E U C Requests classifier copies localPoints action zero first : ZFSet.{u}) : ZFSet.{u} :=
445
+ ZFSet.sep (fun z => ∃ v ∈ V, ∃ y ∈ Q, z = ZFSet.pair v y ∧
446
+ (ExternalCosetSupport E U C classifier copies zero v y ∨
447
+ ExternalTileSupport E Q Requests localPoints action first v y)) (ZFSet.prod V Q)
448
+
449
+ theorem pair_mem_externalStarSupportGraph (V Q E U C Requests classifier copies localPoints action zero first v y : ZFSet.{u}) :
450
+ ZFSet.pair v y ∈ externalStarSupportGraph V Q E U C Requests classifier copies localPoints action zero first ↔
451
+ v ∈ V ∧ y ∈ Q ∧ (ExternalCosetSupport E U C classifier copies zero v y ∨
452
+ ExternalTileSupport E Q Requests localPoints action first v y) := by
453
+ rw [externalStarSupportGraph, ZFSet.mem_sep]
454
+ constructor
455
+ · rintro ⟨_, v', hv, y', hy, equal, body⟩
456
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
457
+ exact ⟨hv, hy, body⟩
458
+ · rintro ⟨hv, hy, body⟩
459
+ exact ⟨ZFSet.pair_mem_prod.2 ⟨hv, hy⟩, v, hv, y, hy, rfl, body⟩
460
+
461
+ namespace BoundedFormula
462
+
463
+ def externalCosetSupportFormula {n} (E U C classifier copies zero v y : Fin n) : BoundedFormula n :=
464
+ exMem C (exMem E.succ (exMem U.succ.succ
465
+ (.conj (orderedPairFormula v.succ.succ.succ zero.succ.succ.succ 2)
466
+ (.conj (pairMembershipFormula 1 2 classifier.succ.succ.succ)
467
+ (tripleMembershipFormula 1 0 y.succ.succ.succ copies.succ.succ.succ)))))
468
+
469
+ theorem truth_externalCosetSupportFormula {n} (E U C classifier copies zero v y : Fin n) (env : Fin n → ZFSet.{u}) :
470
+ Truth (externalCosetSupportFormula E U C classifier copies zero v y) env ↔
471
+ ExternalCosetSupport (env E) (env U) (env C) (env classifier) (env copies) (env zero) (env v) (env y) := by
472
+ simp only [externalCosetSupportFormula, truth_exMem, Truth, truth_orderedPairFormula,
473
+ truth_pairMembershipFormula, truth_tripleMembershipFormula, ExternalCosetSupport]
474
+ rfl
475
+
476
+ def externalTileSupportFormula {n} (E Q Requests localPoints action first v y : Fin n) : BoundedFormula n :=
477
+ exMem E (exMem Requests.succ (exMem Q.succ.succ
478
+ (.conj (orderedRightTripleFormula v.succ.succ.succ first.succ.succ.succ 2 1)
479
+ (.conj (pairMembershipFormula 1 0 localPoints.succ.succ.succ)
480
+ (tripleMembershipFormula 2 0 y.succ.succ.succ action.succ.succ.succ)))))
481
+
482
+ theorem truth_externalTileSupportFormula {n} (E Q Requests localPoints action first v y : Fin n) (env : Fin n → ZFSet.{u}) :
483
+ Truth (externalTileSupportFormula E Q Requests localPoints action first v y) env ↔
484
+ ExternalTileSupport (env E) (env Q) (env Requests) (env localPoints) (env action) (env first) (env v) (env y) := by
485
+ simp only [externalTileSupportFormula, truth_exMem, Truth, truth_orderedRightTripleFormula,
486
+ truth_pairMembershipFormula, truth_tripleMembershipFormula, ExternalTileSupport]
487
+ rfl
488
+
489
+ def externalStarSupportEntryFormula {n} (z V Q E U C Requests classifier copies localPoints action zero first : Fin n) : BoundedFormula n :=
490
+ exMem V (exMem Q.succ (.conj (orderedPairFormula z.succ.succ 1 0)
491
+ (.disj (externalCosetSupportFormula E.succ.succ U.succ.succ C.succ.succ
492
+ classifier.succ.succ copies.succ.succ zero.succ.succ 1 0)
493
+ (externalTileSupportFormula E.succ.succ Q.succ.succ Requests.succ.succ
494
+ localPoints.succ.succ action.succ.succ first.succ.succ 1 0))))
495
+
496
+ theorem truth_externalStarSupportEntryFormula {n} (z V Q E U C Requests classifier copies localPoints action zero first : Fin n)
497
+ (env : Fin n → ZFSet.{u}) :
498
+ Truth (externalStarSupportEntryFormula z V Q E U C Requests classifier copies localPoints action zero first) env ↔
499
+ env z ∈ externalStarSupportGraph (env V) (env Q) (env E) (env U) (env C) (env Requests)
500
+ (env classifier) (env copies) (env localPoints) (env action) (env zero) (env first) := by
501
+ simp only [externalStarSupportEntryFormula, truth_exMem, Truth, truth_disj, truth_orderedPairFormula,
502
+ truth_externalCosetSupportFormula, truth_externalTileSupportFormula, externalStarSupportGraph, ZFSet.mem_sep]
503
+ refine ⟨fun body => ⟨?_, body⟩, And.right⟩
504
+ obtain ⟨v, hv, y, hy, equal, _⟩ := body
505
+ change env z = ZFSet.pair v y at equal
506
+ rw [equal]
507
+ exact ZFSet.pair_mem_prod.2 ⟨hv, hy⟩
508
+ end BoundedFormula
509
+
510
+ namespace TransitiveGround
511
+ variable (M : TransitiveGround.{u})
512
+ theorem externalStarSupportGraph_mem
513
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
514
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
515
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
516
+ {V Q E U C Requests classifier copies localPoints action zero first : ZFSet.{u}}
517
+ (hV : V ∈ M.sets) (hQ : Q ∈ M.sets) (hE : E ∈ M.sets) (hU : U ∈ M.sets)
518
+ (hC : C ∈ M.sets) (hRequests : Requests ∈ M.sets) (hClassifier : classifier ∈ M.sets)
519
+ (hCopies : copies ∈ M.sets) (hLocal : localPoints ∈ M.sets) (hAction : action ∈ M.sets)
520
+ (hZero : zero ∈ M.sets) (hFirst : first ∈ M.sets) :
521
+ externalStarSupportGraph V Q E U C Requests classifier copies localPoints action zero first ∈ M.sets := by
522
+ let params := extend V (extend Q (extend E (extend U (extend C (extend Requests (extend classifier (extend copies (extend localPoints (extend action (extend zero (extend first (Fin.elim0))))))))))))
523
+ have members : ∀ i, params i ∈ M.sets := Fin.cases hV (Fin.cases hQ (Fin.cases hE (Fin.cases hU (Fin.cases hC (Fin.cases hRequests (Fin.cases hClassifier (Fin.cases hCopies (Fin.cases hLocal (Fin.cases hAction (Fin.cases hZero (Fin.cases hFirst ((fun i => Fin.elim0 i)))))))))))))
524
+ have selected := M.bounded_separation_mem separation
525
+ (BoundedFormula.externalStarSupportEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12) params members
526
+ (M.prod_mem pairing unions powers separation hV hQ)
527
+ have equal : ZFSet.sep (fun z => BoundedFormula.Truth
528
+ (BoundedFormula.externalStarSupportEntryFormula 0 1 2 3 4 5 6 7 8 9 10 11 12) (extend z params))
529
+ (ZFSet.prod V Q) = externalStarSupportGraph V Q E U C Requests classifier copies localPoints action zero first := by
530
+ apply ZFSet.ext
531
+ intro z
532
+ rw [ZFSet.mem_sep, BoundedFormula.truth_externalStarSupportEntryFormula]
533
+ change (z ∈ ZFSet.prod V Q ∧ z ∈ externalStarSupportGraph V Q E U C Requests classifier copies localPoints action zero first) ↔ _
534
+ exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩
535
+ exact equal ▸ selected
536
+
537
+ end TransitiveGround
538
+
539
+
540
+
541
+
542
+
543
+ def parentSupportGraph (V Q supports parents : ZFSet.{u}) : ZFSet.{u} :=
544
+ ZFSet.sep (fun z => ∃ v ∈ V, ∃ y ∈ Q, z = ZFSet.pair v y ∧ ZFSet.pair v y ∈ supports ∧
545
+ ∃ p ∈ V, ZFSet.pair v p ∈ parents ∧ ZFSet.pair p y ∈ supports) (ZFSet.prod V Q)
546
+
547
+ def freshSupportGraph (V Q supports parents : ZFSet.{u}) : ZFSet.{u} :=
548
+ ZFSet.sep (fun z => z ∉ parentSupportGraph V Q supports parents) supports
549
+
550
+ theorem pair_mem_parentSupportGraph (V Q supports parents v y : ZFSet.{u}) :
551
+ ZFSet.pair v y ∈ parentSupportGraph V Q supports parents ↔ v ∈ V ∧ y ∈ Q ∧
552
+ ZFSet.pair v y ∈ supports ∧ ∃ p ∈ V, ZFSet.pair v p ∈ parents ∧ ZFSet.pair p y ∈ supports := by
553
+ rw [parentSupportGraph, ZFSet.mem_sep]
554
+ constructor
555
+ · rintro ⟨_, v', hv, y', hy, equal, body⟩
556
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
557
+ exact ⟨hv, hy, body⟩
558
+ · rintro ⟨hv, hy, body⟩
559
+ exact ⟨ZFSet.pair_mem_prod.2 ⟨hv, hy⟩, v, hv, y, hy, rfl, body⟩
560
+
561
+ theorem pair_mem_parentSupportGraph_of_parent {V Q supports parents v p y : ZFSet.{u}}
562
+ (function : ZFSet.IsFunc V V parents) (parent : ZFSet.pair v p ∈ parents) :
563
+ ZFSet.pair v y ∈ parentSupportGraph V Q supports parents ↔
564
+ y ∈ Q ∧ ZFSet.pair v y ∈ supports ∧ ZFSet.pair p y ∈ supports := by
565
+ have shape := ZFSet.pair_mem_prod.1 (function.1 parent)
566
+ rw [pair_mem_parentSupportGraph]
567
+ constructor
568
+ · rintro ⟨_, hy, supported, p', _, atParent, supportedParent⟩
569
+ have equal := (show FunctionGraphOn V parents from ⟨V, function⟩).unique atParent parent
570
+ exact ⟨hy, supported, equal ▸ supportedParent⟩
571
+ · rintro ⟨hy, supported, supportedParent⟩
572
+ exact ⟨shape.1, hy, supported, p, shape.2, parent, supportedParent⟩
573
+
574
+ theorem pair_mem_freshSupportGraph (V Q supports parents v y : ZFSet.{u}) :
575
+ ZFSet.pair v y ∈ freshSupportGraph V Q supports parents ↔
576
+ ZFSet.pair v y ∈ supports ∧ ZFSet.pair v y ∉ parentSupportGraph V Q supports parents := by
577
+ exact ZFSet.mem_sep
578
+
579
+ namespace BoundedFormula
580
+ def parentSupportEntryFormula {n} (z V Q supports parents : Fin n) : BoundedFormula n :=
581
+ exMem V (exMem Q.succ (.conj (orderedPairFormula z.succ.succ 1 0)
582
+ (.conj (pairMembershipFormula 1 0 supports.succ.succ)
583
+ (exMem V.succ.succ (.conj (pairMembershipFormula 2 0 parents.succ.succ.succ)
584
+ (pairMembershipFormula 0 1 supports.succ.succ.succ))))))
585
+
586
+ theorem truth_parentSupportEntryFormula {n} (z V Q supports parents : Fin n) (env : Fin n → ZFSet.{u}) :
587
+ Truth (parentSupportEntryFormula z V Q supports parents) env ↔
588
+ env z ∈ parentSupportGraph (env V) (env Q) (env supports) (env parents) := by
589
+ simp only [parentSupportEntryFormula, truth_exMem, Truth, truth_orderedPairFormula,
590
+ truth_pairMembershipFormula, parentSupportGraph, ZFSet.mem_sep]
591
+ refine ⟨fun h => ⟨?_, h⟩, And.right⟩
592
+ obtain ⟨v, hv, y, hy, equal, _⟩ := h
593
+ change env z = ZFSet.pair v y at equal
594
+ rw [equal]
595
+ exact ZFSet.pair_mem_prod.2 ⟨hv, hy⟩
596
+ end BoundedFormula
597
+
598
+ namespace TransitiveGround
599
+ variable (M : TransitiveGround.{u})
600
+ variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
601
+ variable (unions : Realize M.sets SetFormula.union Fin.elim0)
602
+ variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
603
+ variable {V Q supports parents : ZFSet.{u}} (hV : V ∈ M.sets) (hQ : Q ∈ M.sets)
604
+ variable (hSupports : supports ∈ M.sets) (hParents : parents ∈ M.sets)
605
+ include pairing unions powers separation hV hQ hSupports hParents
606
+
607
+ theorem parentSupportGraph_mem : parentSupportGraph V Q supports parents ∈ M.sets := by
608
+ let params := extend V (extend Q (extend supports (extend parents Fin.elim0)))
609
+ have selected := M.bounded_separation_mem separation
610
+ (BoundedFormula.parentSupportEntryFormula 0 1 2 3 4) params
611
+ (Fin.cases hV (Fin.cases hQ (Fin.cases hSupports (Fin.cases hParents (fun i => Fin.elim0 i)))))
612
+ (M.prod_mem pairing unions powers separation hV hQ)
613
+ have equal : ZFSet.sep (fun z => BoundedFormula.Truth
614
+ (BoundedFormula.parentSupportEntryFormula 0 1 2 3 4) (extend z params)) (ZFSet.prod V Q) =
615
+ parentSupportGraph V Q supports parents := by
616
+ apply ZFSet.ext
617
+ intro z
618
+ rw [ZFSet.mem_sep, BoundedFormula.truth_parentSupportEntryFormula]
619
+ exact ⟨And.right, fun hz => ⟨(ZFSet.mem_sep.1 hz).1, hz⟩⟩
620
+ exact equal ▸ selected
621
+
622
+ theorem freshSupportGraph_mem : freshSupportGraph V Q supports parents ∈ M.sets := by
623
+ have parentGround := M.parentSupportGraph_mem pairing unions powers separation hV hQ hSupports hParents
624
+ exact M.bounded_separation_mem separation (BoundedFormula.neg (.mem 0 1))
625
+ (extend (parentSupportGraph V Q supports parents) Fin.elim0)
626
+ (Fin.cases parentGround (fun i => Fin.elim0 i)) hSupports
627
+
628
+ end TransitiveGround
629
+
630
+ end PartitionPilot.Forcing
631
+
632
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/PartitionPrincipleFormula.lean CHANGED
@@ -1,50 +1,50 @@
1
- import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSizeWitnesses
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing.BoundedFormula
8
- open SetFormula
9
- universe u
10
-
11
- theorem truth_surjectionFormula {n : Nat} (a b f : Fin n) (env : Fin n → ZFSet.{u}) :
12
- Truth (surjectionFormula a b f) env ↔ ZFSet.IsFunc (env a) (env b) (env f) ∧
13
- ∀ y ∈ env b, ∃ x ∈ env a, ZFSet.pair x y ∈ env f := by
14
- simp only [surjectionFormula, Truth, truth_functionFormula, truth_exMem,
15
- truth_pairMembershipFormula]
16
- rfl
17
-
18
- end PartitionPilot.Forcing.BoundedFormula
19
-
20
- namespace PartitionPilot.Forcing.SetFormula
21
-
22
- end PartitionPilot.Forcing.SetFormula
23
-
24
- namespace PartitionPilot.Forcing.TransitiveGround
25
- open SetFormula
26
- universe u
27
-
28
- theorem realize_partitionPrinciple (M : TransitiveGround.{u}) :
29
- Realize M.sets partitionPrinciple Fin.elim0 ↔
30
- ∀ X ∈ M.sets, ∀ Y ∈ M.sets, ∀ f ∈ M.sets, ZFSet.IsFunc X Y f →
31
- (∀ y ∈ Y, ∃ x ∈ X, ZFSet.pair x y ∈ f) → M.groundEmbeddable Y X := by
32
- change (∀ X ∈ M.sets, ∀ Y ∈ M.sets, ∀ f ∈ M.sets,
33
- Realize M.sets (imp (BoundedFormula.surjectionFormula (n := 3) 2 1 0).toFormula
34
- (hasInjectionFormula (n := 3) 1 2)) (extend f (extend Y (extend X Fin.elim0)))) ↔ _
35
- apply forall_congr' fun X => forall_congr' fun hX =>
36
- forall_congr' fun Y => forall_congr' fun hY =>
37
- forall_congr' fun f => forall_congr' fun hf => ?_
38
- let env := extend f (extend Y (extend X Fin.elim0))
39
- have members : ∀ j, env j ∈ M.sets :=
40
- Fin.cases hf (Fin.cases hY (Fin.cases hX (fun j => Fin.elim0 j)))
41
- rw [realize_imp, M.realize_hasInjectionFormula 1 2 env members,
42
- BoundedFormula.realize_toFormula M _ env members, BoundedFormula.truth_surjectionFormula]
43
- exact ⟨fun h function onto => h ⟨function, onto⟩,
44
- fun h ⟨function, onto⟩ => h function onto⟩
45
-
46
- end PartitionPilot.Forcing.TransitiveGround
47
-
48
- end
49
-
50
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSizeWitnesses
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing.BoundedFormula
8
+ open SetFormula
9
+ universe u
10
+
11
+ theorem truth_surjectionFormula {n : Nat} (a b f : Fin n) (env : Fin n → ZFSet.{u}) :
12
+ Truth (surjectionFormula a b f) env ↔ ZFSet.IsFunc (env a) (env b) (env f) ∧
13
+ ∀ y ∈ env b, ∃ x ∈ env a, ZFSet.pair x y ∈ env f := by
14
+ simp only [surjectionFormula, Truth, truth_functionFormula, truth_exMem,
15
+ truth_pairMembershipFormula]
16
+ rfl
17
+
18
+ end PartitionPilot.Forcing.BoundedFormula
19
+
20
+ namespace PartitionPilot.Forcing.SetFormula
21
+
22
+ end PartitionPilot.Forcing.SetFormula
23
+
24
+ namespace PartitionPilot.Forcing.TransitiveGround
25
+ open SetFormula
26
+ universe u
27
+
28
+ theorem realize_partitionPrinciple (M : TransitiveGround.{u}) :
29
+ Realize M.sets partitionPrinciple Fin.elim0 ↔
30
+ ∀ X ∈ M.sets, ∀ Y ∈ M.sets, ∀ f ∈ M.sets, ZFSet.IsFunc X Y f →
31
+ (∀ y ∈ Y, ∃ x ∈ X, ZFSet.pair x y ∈ f) → M.groundEmbeddable Y X := by
32
+ change (∀ X ∈ M.sets, ∀ Y ∈ M.sets, ∀ f ∈ M.sets,
33
+ Realize M.sets (imp (BoundedFormula.surjectionFormula (n := 3) 2 1 0).toFormula
34
+ (hasInjectionFormula (n := 3) 1 2)) (extend f (extend Y (extend X Fin.elim0)))) ↔ _
35
+ apply forall_congr' fun X => forall_congr' fun hX =>
36
+ forall_congr' fun Y => forall_congr' fun hY =>
37
+ forall_congr' fun f => forall_congr' fun hf => ?_
38
+ let env := extend f (extend Y (extend X Fin.elim0))
39
+ have members : ∀ j, env j ∈ M.sets :=
40
+ Fin.cases hf (Fin.cases hY (Fin.cases hX (fun j => Fin.elim0 j)))
41
+ rw [realize_imp, M.realize_hasInjectionFormula 1 2 env members,
42
+ BoundedFormula.realize_toFormula M _ env members, BoundedFormula.truth_surjectionFormula]
43
+ exact ⟨fun h function onto => h ⟨function, onto⟩,
44
+ fun h ⟨function, onto⟩ => h function onto⟩
45
+
46
+ end PartitionPilot.Forcing.TransitiveGround
47
+
48
+ end
49
+
50
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/PreparedCertificateCodes.lean CHANGED
@@ -1,181 +1,181 @@
1
- import OAI.SetTheory.PartitionPrinciple.Geometry.GroundVisibilitySupportIncidence
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
- universe u
9
-
10
- def SynchronizedEnumerationCode (omega N B f e names : ZFSet.{u}) : Prop :=
11
- ZFSet.IsFunc B N f ∧ ZFSet.IsFunc omega B e ∧ ZFSet.IsFunc omega N names ∧
12
- (∀ v ∈ B, ∃ n ∈ omega, ZFSet.pair n v ∈ e) ∧
13
- (∀ n ∈ omega, ∀ v tau, ZFSet.pair n v ∈ e →
14
- ZFSet.pair n tau ∈ names → ZFSet.pair v tau ∈ f) ∧
15
- (∀ n ∈ omega, ∀ v tau, ZFSet.pair n v ∈ e →
16
- ZFSet.pair v tau ∈ f → ZFSet.pair n tau ∈ names)
17
-
18
- namespace BoundedFormula
19
- open SetFormula
20
-
21
- def synchronizedEnumerationFormula {n} (omega N B f e names : Fin n) : BoundedFormula n :=
22
- .conj (functionFormula B N f)
23
- (.conj (functionFormula omega B e)
24
- (.conj (functionFormula omega N names)
25
- (.conj (.allMem B (exMem omega.succ (pairMembershipFormula 0 1 e.succ.succ)))
26
- (.conj
27
- (.allMem omega (.allMem B.succ (.allMem N.succ.succ
28
- (imp (pairMembershipFormula 2 1 e.succ.succ.succ)
29
- (imp (pairMembershipFormula 2 0 names.succ.succ.succ)
30
- (pairMembershipFormula 1 0 f.succ.succ.succ))))))
31
- (.allMem omega (.allMem B.succ (.allMem N.succ.succ
32
- (imp (pairMembershipFormula 2 1 e.succ.succ.succ)
33
- (imp (pairMembershipFormula 1 0 f.succ.succ.succ)
34
- (pairMembershipFormula 2 0 names.succ.succ.succ))))))))))
35
-
36
- theorem truth_synchronizedEnumerationFormula {n} (omega N B f e names : Fin n)
37
- (env : Fin n → ZFSet.{u}) :
38
- Truth (synchronizedEnumerationFormula omega N B f e names) env ↔
39
- SynchronizedEnumerationCode (env omega) (env N) (env B) (env f) (env e) (env names) := by
40
- simp only [synchronizedEnumerationFormula, Truth, truth_functionFormula,
41
- truth_exMem, truth_pairMembershipFormula, truth_imp]
42
- change (ZFSet.IsFunc (env B) (env N) (env f) ∧
43
- ZFSet.IsFunc (env omega) (env B) (env e) ∧
44
- ZFSet.IsFunc (env omega) (env N) (env names) ∧
45
- (∀ v ∈ env B, ∃ n ∈ env omega, ZFSet.pair n v ∈ env e) ∧
46
- (∀ n ∈ env omega, ∀ v ∈ env B, ∀ tau ∈ env N, ZFSet.pair n v ∈ env e →
47
- ZFSet.pair n tau ∈ env names → ZFSet.pair v tau ∈ env f) ∧
48
- (∀ n ∈ env omega, ∀ v ∈ env B, ∀ tau ∈ env N, ZFSet.pair n v ∈ env e →
49
- ZFSet.pair v tau ∈ env f → ZFSet.pair n tau ∈ env names)) ↔ _
50
- constructor
51
- · rintro ⟨ff, ef, nf, onto, forward, backward⟩
52
- refine ⟨ff, ef, nf, onto, ?_, ?_⟩
53
- · intro n hn v tau nv nt
54
- exact forward n hn v (ZFSet.pair_mem_prod.1 (ef.1 nv)).2
55
- tau (ZFSet.pair_mem_prod.1 (nf.1 nt)).2 nv nt
56
- · intro n hn v tau nv vt
57
- exact backward n hn v (ZFSet.pair_mem_prod.1 (ef.1 nv)).2
58
- tau (ZFSet.pair_mem_prod.1 (ff.1 vt)).2 nv vt
59
- · rintro ⟨ff, ef, nf, onto, forward, backward⟩
60
- exact ⟨ff, ef, nf, onto, fun n hn v _ tau _ => forward n hn v tau,
61
- fun n hn v _ tau _ => backward n hn v tau⟩
62
-
63
- def certificateEnumerationEntryFormula {n} (entry J E Names omega N k : Fin n) :
64
- BoundedFormula n :=
65
- exPairFields entry (exPairFields 0
66
- (exGraphFields k.succ.succ.succ.succ (exPairFields 0 (exPairFields 0
67
- (.conj (.equal 5 9)
68
- (.conj (.mem 9 J.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ)
69
- (.conj (.mem 7 E.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ)
70
- (.conj (.mem 6 Names.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ)
71
- (synchronizedEnumerationFormula
72
- omega.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ
73
- N.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ 1 0 7 6)))))))))
74
-
75
- theorem truth_certificateEnumerationEntryFormula {n} (entry J E Names omega N k : Fin n)
76
- (env : Fin n → ZFSet.{u}) :
77
- Truth (certificateEnumerationEntryFormula entry J E Names omega N k) env ↔
78
- ∃ j ∈ env J, ∃ e ∈ env E, ∃ names ∈ env Names,
79
- env entry = ZFSet.pair j (ZFSet.pair e names) ∧
80
- ∃ F B f, ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ env k ∧
81
- SynchronizedEnumerationCode (env omega) (env N) B f e names := by
82
- simp only [certificateEnumerationEntryFormula, truth_exPairFields, truth_exGraphFields,
83
- Truth, truth_synchronizedEnumerationFormula]
84
- change (∃ j pair, env entry = ZFSet.pair j pair ∧
85
- ∃ e names, pair = ZFSet.pair e names ∧
86
- ∃ j' certificate, ZFSet.pair j' certificate ∈ env k ∧
87
- ∃ F tail, certificate = ZFSet.pair F tail ∧
88
- ∃ B f, tail = ZFSet.pair B f ∧ j' = j ∧
89
- j ∈ env J ∧ e ∈ env E ∧ names ∈ env Names ∧
90
- SynchronizedEnumerationCode (env omega) (env N) B f e names) ↔ _
91
- constructor
92
- · rintro ⟨j, pair, eq, e, names, rfl, j', certificate, stored,
93
- F, tail, rfl, B, f, rfl, rfl, hj, he, hn, code⟩
94
- exact ���j', hj, e, he, names, hn, eq, F, B, f, stored, code⟩
95
- · rintro ⟨j, hj, e, he, names, hn, eq, F, B, f, stored, code⟩
96
- exact ⟨j, _, eq, e, names, rfl, j, _, stored, F, _, rfl,
97
- B, f, rfl, rfl, hj, he, hn, code⟩
98
-
99
- end BoundedFormula
100
-
101
- end PartitionPilot.Forcing
102
-
103
-
104
-
105
- namespace PartitionPilot.Forcing
106
- open SetFormula
107
- universe u
108
-
109
- def PreparedCertificateCode (M : TransitiveGround.{u})
110
- (P order q nodes nodeOrder meet N visibility top omega z F B f e names : ZFSet.{u}) : Prop :=
111
- MeetFilterCode nodes nodeOrder meet F ∧
112
- CoinitialBelowCode nodeOrder F F B ∧ B.Nonempty ∧
113
- SynchronizedEnumerationCode omega N B f e names ∧
114
- (∀ v tau, ZFSet.pair v tau ∈ f →
115
- ZFSet.pair v tau ∈ visibilitySupportIncidence nodes N visibility top) ∧
116
- PreparationForcingCode M P order q nodes visibility z F f
117
-
118
- namespace SetFormula
119
-
120
- def preparedCertificateFormula {n}
121
- (P order q nodes nodeOrder meet N visibility top omega z F B f e names : Fin n) : SetFormula n :=
122
- .conj (BoundedFormula.meetFilterFormula nodes nodeOrder meet F).toFormula
123
- (.conj (BoundedFormula.coinitialBelowFormula nodeOrder F F B).toFormula
124
- (.conj (BoundedFormula.exMem B (.equal 0 0)).toFormula
125
- (.conj (BoundedFormula.synchronizedEnumerationFormula omega N B f e names).toFormula
126
- (.conj (allGraphFields f
127
- (BoundedFormula.visibilitySupportAt 1 0 nodes.succ.succ N.succ.succ
128
- visibility.succ.succ top.succ.succ).toFormula)
129
- (preparationForcingFormula P order q nodes visibility z F f)))))
130
-
131
- end SetFormula
132
- namespace TransitiveGround
133
- variable (M : TransitiveGround.{u})
134
-
135
- theorem realize_preparedCertificateFormula {n}
136
- (P order q nodes nodeOrder meet N visibility top omega z F B f e names : Fin n)
137
- (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets)
138
- (meetCode : MeetOrderCode (env nodes) (env nodeOrder) (env meet)) :
139
- Realize M.sets
140
- (preparedCertificateFormula P order q nodes nodeOrder meet N visibility top omega z F B f e names) env ↔
141
- PreparedCertificateCode M (env P) (env order) (env q) (env nodes) (env nodeOrder)
142
- (env meet) (env N) (env visibility) (env top) (env omega) (env z)
143
- (env F) (env B) (env f) (env e) (env names) := by
144
- have nonempty : Realize M.sets (BoundedFormula.exMem B (.equal 0 0)).toFormula env ↔
145
- (env B).Nonempty := by
146
- rw [BoundedFormula.realize_toFormula M _ env members, BoundedFormula.truth_exMem]
147
- simp only [BoundedFormula.Truth, and_true]
148
- rfl
149
- have supported : Realize M.sets (allGraphFields f
150
- (BoundedFormula.visibilitySupportAt 1 0 nodes.succ.succ N.succ.succ
151
- visibility.succ.succ top.succ.succ).toFormula) env ↔
152
- ∀ v tau, ZFSet.pair v tau ∈ env f →
153
- ZFSet.pair v tau ∈ visibilitySupportIncidence (env nodes) (env N) (env visibility) (env top) := by
154
- rw [M.realize_allGraphFields _ _ env members]
155
- constructor
156
- · intro holds v tau entry
157
- have pairGround := M.transitive (members f) entry
158
- exact (BoundedFormula.truth_visibilitySupportAt _ _ _ _ _ _ _).1
159
- ((BoundedFormula.realize_toFormula M _ _
160
- (Fin.cases (M.pair_right pairGround) (Fin.cases (M.pair_left pairGround) members))).1
161
- (holds v tau entry))
162
- · intro holds v tau entry
163
- have pairGround := M.transitive (members f) entry
164
- exact (BoundedFormula.realize_toFormula M _ _
165
- (Fin.cases (M.pair_right pairGround) (Fin.cases (M.pair_left pairGround) members))).2
166
- ((BoundedFormula.truth_visibilitySupportAt _ _ _ _ _ _ _).2 (holds v tau entry))
167
- simp only [preparedCertificateFormula, Realize]
168
- rw [BoundedFormula.realize_meetFilterFormula M _ _ _ _ env members meetCode,
169
- BoundedFormula.realize_coinitialBelowFormula M _ _ _ _ env members,
170
- nonempty, BoundedFormula.realize_toFormula M _ env members,
171
- BoundedFormula.truth_synchronizedEnumerationFormula, supported,
172
- M.realize_preparationForcingFormula _ _ _ _ _ _ _ _ env members]
173
- rfl
174
-
175
- end TransitiveGround
176
-
177
- end PartitionPilot.Forcing
178
-
179
- end
180
-
181
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Geometry.GroundVisibilitySupportIncidence
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+ universe u
9
+
10
+ def SynchronizedEnumerationCode (omega N B f e names : ZFSet.{u}) : Prop :=
11
+ ZFSet.IsFunc B N f ∧ ZFSet.IsFunc omega B e ∧ ZFSet.IsFunc omega N names ∧
12
+ (∀ v ∈ B, ∃ n ∈ omega, ZFSet.pair n v ∈ e) ∧
13
+ (∀ n ∈ omega, ∀ v tau, ZFSet.pair n v ∈ e →
14
+ ZFSet.pair n tau ∈ names → ZFSet.pair v tau ∈ f) ∧
15
+ (∀ n ∈ omega, ∀ v tau, ZFSet.pair n v ∈ e →
16
+ ZFSet.pair v tau ∈ f → ZFSet.pair n tau ∈ names)
17
+
18
+ namespace BoundedFormula
19
+ open SetFormula
20
+
21
+ def synchronizedEnumerationFormula {n} (omega N B f e names : Fin n) : BoundedFormula n :=
22
+ .conj (functionFormula B N f)
23
+ (.conj (functionFormula omega B e)
24
+ (.conj (functionFormula omega N names)
25
+ (.conj (.allMem B (exMem omega.succ (pairMembershipFormula 0 1 e.succ.succ)))
26
+ (.conj
27
+ (.allMem omega (.allMem B.succ (.allMem N.succ.succ
28
+ (imp (pairMembershipFormula 2 1 e.succ.succ.succ)
29
+ (imp (pairMembershipFormula 2 0 names.succ.succ.succ)
30
+ (pairMembershipFormula 1 0 f.succ.succ.succ))))))
31
+ (.allMem omega (.allMem B.succ (.allMem N.succ.succ
32
+ (imp (pairMembershipFormula 2 1 e.succ.succ.succ)
33
+ (imp (pairMembershipFormula 1 0 f.succ.succ.succ)
34
+ (pairMembershipFormula 2 0 names.succ.succ.succ))))))))))
35
+
36
+ theorem truth_synchronizedEnumerationFormula {n} (omega N B f e names : Fin n)
37
+ (env : Fin n → ZFSet.{u}) :
38
+ Truth (synchronizedEnumerationFormula omega N B f e names) env ↔
39
+ SynchronizedEnumerationCode (env omega) (env N) (env B) (env f) (env e) (env names) := by
40
+ simp only [synchronizedEnumerationFormula, Truth, truth_functionFormula,
41
+ truth_exMem, truth_pairMembershipFormula, truth_imp]
42
+ change (ZFSet.IsFunc (env B) (env N) (env f) ∧
43
+ ZFSet.IsFunc (env omega) (env B) (env e) ∧
44
+ ZFSet.IsFunc (env omega) (env N) (env names) ∧
45
+ (∀ v ∈ env B, ∃ n ∈ env omega, ZFSet.pair n v ∈ env e) ∧
46
+ (∀ n ∈ env omega, ∀ v ∈ env B, ∀ tau ∈ env N, ZFSet.pair n v ∈ env e →
47
+ ZFSet.pair n tau ∈ env names → ZFSet.pair v tau ∈ env f) ∧
48
+ (∀ n ∈ env omega, ∀ v ∈ env B, ∀ tau ∈ env N, ZFSet.pair n v ∈ env e →
49
+ ZFSet.pair v tau ∈ env f → ZFSet.pair n tau ∈ env names)) ↔ _
50
+ constructor
51
+ · rintro ⟨ff, ef, nf, onto, forward, backward⟩
52
+ refine ⟨ff, ef, nf, onto, ?_, ?_⟩
53
+ · intro n hn v tau nv nt
54
+ exact forward n hn v (ZFSet.pair_mem_prod.1 (ef.1 nv)).2
55
+ tau (ZFSet.pair_mem_prod.1 (nf.1 nt)).2 nv nt
56
+ · intro n hn v tau nv vt
57
+ exact backward n hn v (ZFSet.pair_mem_prod.1 (ef.1 nv)).2
58
+ tau (ZFSet.pair_mem_prod.1 (ff.1 vt)).2 nv vt
59
+ · rintro ⟨ff, ef, nf, onto, forward, backward⟩
60
+ exact ⟨ff, ef, nf, onto, fun n hn v _ tau _ => forward n hn v tau,
61
+ fun n hn v _ tau _ => backward n hn v tau⟩
62
+
63
+ def certificateEnumerationEntryFormula {n} (entry J E Names omega N k : Fin n) :
64
+ BoundedFormula n :=
65
+ exPairFields entry (exPairFields 0
66
+ (exGraphFields k.succ.succ.succ.succ (exPairFields 0 (exPairFields 0
67
+ (.conj (.equal 5 9)
68
+ (.conj (.mem 9 J.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ)
69
+ (.conj (.mem 7 E.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ)
70
+ (.conj (.mem 6 Names.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ)
71
+ (synchronizedEnumerationFormula
72
+ omega.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ
73
+ N.succ.succ.succ.succ.succ.succ.succ.succ.succ.succ 1 0 7 6)))))))))
74
+
75
+ theorem truth_certificateEnumerationEntryFormula {n} (entry J E Names omega N k : Fin n)
76
+ (env : Fin n → ZFSet.{u}) :
77
+ Truth (certificateEnumerationEntryFormula entry J E Names omega N k) env ↔
78
+ ∃ j ∈ env J, ∃ e ∈ env E, ∃ names ∈ env Names,
79
+ env entry = ZFSet.pair j (ZFSet.pair e names) ∧
80
+ ∃ F B f, ZFSet.pair j (ZFSet.pair F (ZFSet.pair B f)) ∈ env k ∧
81
+ SynchronizedEnumerationCode (env omega) (env N) B f e names := by
82
+ simp only [certificateEnumerationEntryFormula, truth_exPairFields, truth_exGraphFields,
83
+ Truth, truth_synchronizedEnumerationFormula]
84
+ change (∃ j pair, env entry = ZFSet.pair j pair ∧
85
+ ∃ e names, pair = ZFSet.pair e names ∧
86
+ ∃ j' certificate, ZFSet.pair j' certificate ∈ env k ∧
87
+ ∃ F tail, certificate = ZFSet.pair F tail ∧
88
+ ∃ B f, tail = ZFSet.pair B f ∧ j' = j ∧
89
+ j ∈ env J ∧ e ∈ env E ∧ names ∈ env Names ∧
90
+ SynchronizedEnumerationCode (env omega) (env N) B f e names) ↔ _
91
+ constructor
92
+ · rintro ⟨j, pair, eq, e, names, rfl, j', certificate, stored,
93
+ F, tail, rfl, B, f, rfl, rfl, hj, he, hn, code⟩
94
+ exact ⟨j', hj, e, he, names, hn, eq, F, B, f, stored, code⟩
95
+ · rintro ⟨j, hj, e, he, names, hn, eq, F, B, f, stored, code⟩
96
+ exact ⟨j, _, eq, e, names, rfl, j, _, stored, F, _, rfl,
97
+ B, f, rfl, rfl, hj, he, hn, code⟩
98
+
99
+ end BoundedFormula
100
+
101
+ end PartitionPilot.Forcing
102
+
103
+
104
+
105
+ namespace PartitionPilot.Forcing
106
+ open SetFormula
107
+ universe u
108
+
109
+ def PreparedCertificateCode (M : TransitiveGround.{u})
110
+ (P order q nodes nodeOrder meet N visibility top omega z F B f e names : ZFSet.{u}) : Prop :=
111
+ MeetFilterCode nodes nodeOrder meet F ∧
112
+ CoinitialBelowCode nodeOrder F F B ∧ B.Nonempty ∧
113
+ SynchronizedEnumerationCode omega N B f e names ∧
114
+ (∀ v tau, ZFSet.pair v tau ∈ f →
115
+ ZFSet.pair v tau ∈ visibilitySupportIncidence nodes N visibility top) ∧
116
+ PreparationForcingCode M P order q nodes visibility z F f
117
+
118
+ namespace SetFormula
119
+
120
+ def preparedCertificateFormula {n}
121
+ (P order q nodes nodeOrder meet N visibility top omega z F B f e names : Fin n) : SetFormula n :=
122
+ .conj (BoundedFormula.meetFilterFormula nodes nodeOrder meet F).toFormula
123
+ (.conj (BoundedFormula.coinitialBelowFormula nodeOrder F F B).toFormula
124
+ (.conj (BoundedFormula.exMem B (.equal 0 0)).toFormula
125
+ (.conj (BoundedFormula.synchronizedEnumerationFormula omega N B f e names).toFormula
126
+ (.conj (allGraphFields f
127
+ (BoundedFormula.visibilitySupportAt 1 0 nodes.succ.succ N.succ.succ
128
+ visibility.succ.succ top.succ.succ).toFormula)
129
+ (preparationForcingFormula P order q nodes visibility z F f)))))
130
+
131
+ end SetFormula
132
+ namespace TransitiveGround
133
+ variable (M : TransitiveGround.{u})
134
+
135
+ theorem realize_preparedCertificateFormula {n}
136
+ (P order q nodes nodeOrder meet N visibility top omega z F B f e names : Fin n)
137
+ (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets)
138
+ (meetCode : MeetOrderCode (env nodes) (env nodeOrder) (env meet)) :
139
+ Realize M.sets
140
+ (preparedCertificateFormula P order q nodes nodeOrder meet N visibility top omega z F B f e names) env ↔
141
+ PreparedCertificateCode M (env P) (env order) (env q) (env nodes) (env nodeOrder)
142
+ (env meet) (env N) (env visibility) (env top) (env omega) (env z)
143
+ (env F) (env B) (env f) (env e) (env names) := by
144
+ have nonempty : Realize M.sets (BoundedFormula.exMem B (.equal 0 0)).toFormula env ↔
145
+ (env B).Nonempty := by
146
+ rw [BoundedFormula.realize_toFormula M _ env members, BoundedFormula.truth_exMem]
147
+ simp only [BoundedFormula.Truth, and_true]
148
+ rfl
149
+ have supported : Realize M.sets (allGraphFields f
150
+ (BoundedFormula.visibilitySupportAt 1 0 nodes.succ.succ N.succ.succ
151
+ visibility.succ.succ top.succ.succ).toFormula) env ↔
152
+ ∀ v tau, ZFSet.pair v tau ∈ env f →
153
+ ZFSet.pair v tau ∈ visibilitySupportIncidence (env nodes) (env N) (env visibility) (env top) := by
154
+ rw [M.realize_allGraphFields _ _ env members]
155
+ constructor
156
+ · intro holds v tau entry
157
+ have pairGround := M.transitive (members f) entry
158
+ exact (BoundedFormula.truth_visibilitySupportAt _ _ _ _ _ _ _).1
159
+ ((BoundedFormula.realize_toFormula M _ _
160
+ (Fin.cases (M.pair_right pairGround) (Fin.cases (M.pair_left pairGround) members))).1
161
+ (holds v tau entry))
162
+ · intro holds v tau entry
163
+ have pairGround := M.transitive (members f) entry
164
+ exact (BoundedFormula.realize_toFormula M _ _
165
+ (Fin.cases (M.pair_right pairGround) (Fin.cases (M.pair_left pairGround) members))).2
166
+ ((BoundedFormula.truth_visibilitySupportAt _ _ _ _ _ _ _).2 (holds v tau entry))
167
+ simp only [preparedCertificateFormula, Realize]
168
+ rw [BoundedFormula.realize_meetFilterFormula M _ _ _ _ env members meetCode,
169
+ BoundedFormula.realize_coinitialBelowFormula M _ _ _ _ env members,
170
+ nonempty, BoundedFormula.realize_toFormula M _ env members,
171
+ BoundedFormula.truth_synchronizedEnumerationFormula, supported,
172
+ M.realize_preparationForcingFormula _ _ _ _ _ _ _ _ env members]
173
+ rfl
174
+
175
+ end TransitiveGround
176
+
177
+ end PartitionPilot.Forcing
178
+
179
+ end
180
+
181
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/PresentedGroupCodes.lean CHANGED
@@ -1,688 +1,688 @@
1
- import OAI.SetTheory.PartitionPrinciple.Definability.UnionEntryFormula
2
- import OAI.SetTheory.PartitionPrinciple.Transfinite.OrdinalRecursionTraces
3
-
4
- namespace OAI
5
-
6
-
7
- namespace PartitionPilot.Forcing
8
-
9
- namespace BoundedFormula
10
-
11
- open SetFormula
12
- universe u
13
-
14
- def Truth : {n : Nat} → BoundedFormula n → (Fin n → ZFSet.{u}) → Prop
15
- | _, .equal i j, env => env i = env j
16
- | _, .mem i j, env => env i ∈ env j
17
- | _, .neg φ, env => ¬ Truth φ env
18
- | _, .conj φ ψ, env => Truth φ env ∧ Truth ψ env
19
- | _, .allMem b φ, env => ∀ x ∈ env b, Truth φ (extend x env)
20
-
21
- theorem truth_imp {n} (φ ψ : BoundedFormula n) (env : Fin n → ZFSet.{u}) :
22
- Truth (imp φ ψ) env ↔ (Truth φ env → Truth ψ env) := by
23
- classical
24
- simp only [imp, Truth, not_and, not_not]
25
-
26
- theorem truth_disj {n} (φ ψ : BoundedFormula n) (env : Fin n → ZFSet.{u}) :
27
- Truth (disj φ ψ) env ↔ (Truth φ env ∨ Truth ψ env) := by
28
- classical
29
- simp only [disj, Truth, not_and_or, not_not]
30
-
31
- theorem truth_exMem {n} (b : Fin n) (φ : BoundedFormula (n + 1)) (env : Fin n → ZFSet.{u}) :
32
- Truth (exMem b φ) env ↔ ∃ x ∈ env b, Truth φ (extend x env) := by
33
- classical
34
- simp only [exMem, Truth, not_forall, not_not, exists_prop]
35
-
36
- theorem realize_toFormula (M : TransitiveGround.{u}) {n} (φ : BoundedFormula n)
37
- (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) :
38
- Realize M.sets φ.toFormula env ↔ Truth φ env := by
39
- induction φ with
40
- | equal i j => rfl
41
- | mem i j => rfl
42
- | neg φ ih => exact not_congr (ih env members)
43
- | conj φ ψ ihφ ihψ => exact and_congr (ihφ env members) (ihψ env members)
44
- | allMem b φ ih =>
45
- change (∀ x ∈ M.sets, Realize M.sets (SetFormula.imp (.mem 0 b.succ) φ.toFormula) (extend x env)) ↔ _
46
- constructor
47
- · intro h x hx
48
- have hxM := M.transitive (members b) hx
49
- exact (ih (extend x env) (Fin.cases hxM members)).1
50
- ((realize_imp M.sets _ _ _).1 (h x hxM) hx)
51
- · intro h x hxM
52
- apply (realize_imp M.sets _ _ _).2
53
- intro hx
54
- exact (ih (extend x env) (Fin.cases hxM members)).2 (h x hx)
55
-
56
- theorem absolute (M N : TransitiveGround.{u}) {n} (φ : BoundedFormula n)
57
- (env : Fin n → ZFSet.{u}) (inM : ∀ i, env i ∈ M.sets) (inN : ∀ i, env i ∈ N.sets) :
58
- Realize M.sets φ.toFormula env ↔ Realize N.sets φ.toFormula env :=
59
- (realize_toFormula M φ env inM).trans (realize_toFormula N φ env inN).symm
60
-
61
- end BoundedFormula
62
-
63
- end PartitionPilot.Forcing
64
-
65
-
66
-
67
- namespace PartitionPilot.Forcing.BoundedFormula
68
-
69
- open SetFormula
70
- universe u
71
-
72
- def emptyFormula {n} (x : Fin n) : BoundedFormula n :=
73
- .allMem x (.neg (.equal 0 0))
74
-
75
- def successorFormula {n} (y x : Fin n) : BoundedFormula n :=
76
- .conj (.mem x y) (.conj (.allMem x (.mem 0 y.succ))
77
- (.allMem y (disj (.equal 0 x.succ) (.mem 0 x.succ))))
78
-
79
- def setTransitiveFormula {n} (x : Fin n) : BoundedFormula n :=
80
- .allMem x (.allMem 0 (.mem 0 x.succ.succ))
81
-
82
- def zeroOrSuccessorFormula {n} (x : Fin n) : BoundedFormula n :=
83
- disj (emptyFormula x) (exMem x (successorFormula x.succ 0))
84
-
85
- def naturalFormula {n} (x : Fin n) : BoundedFormula n :=
86
- .conj (setTransitiveFormula x) (.conj (zeroOrSuccessorFormula x)
87
- (.allMem x (.conj (setTransitiveFormula 0) (zeroOrSuccessorFormula 0))))
88
-
89
- theorem truth_emptyFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) :
90
- Truth (emptyFormula x) env ↔ env x = ∅ := by
91
- change (∀ y ∈ env x, ¬ y = y) ↔ _
92
- constructor
93
- · intro h
94
- exact (ZFSet.eq_empty _).2 (fun y hy => h y hy rfl)
95
- · intro h y hy
96
- exact False.elim ((ZFSet.eq_empty _).1 h y hy)
97
-
98
- theorem truth_successorFormula {n} (y x : Fin n) (env : Fin n → ZFSet.{u}) :
99
- Truth (successorFormula y x) env ↔ env y = insert (env x) (env x) := by
100
- simp only [successorFormula, Truth, truth_disj]
101
- change (env x ∈ env y ∧ (∀ z ∈ env x, z ∈ env y) ∧
102
- ∀ z ∈ env y, z = env x ∨ z ∈ env x) ↔ _
103
- constructor
104
- · rintro ⟨hx, lower, upper⟩
105
- apply ZFSet.ext
106
- intro z
107
- rw [ZFSet.mem_insert_iff]
108
- exact ⟨upper z, fun h => h.elim (fun eq => eq.symm ▸ hx) (lower z)⟩
109
- · intro eq
110
- rw [eq]
111
- exact ⟨ZFSet.mem_insert _ _, fun _ hz => ZFSet.mem_insert_of_mem _ hz,
112
- fun _ hz => ZFSet.mem_insert_iff.1 hz⟩
113
-
114
- theorem truth_setTransitiveFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) :
115
- Truth (setTransitiveFormula x) env ↔ setTransitive (env x) := Iff.rfl
116
-
117
- theorem truth_zeroOrSuccessorFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) :
118
- Truth (zeroOrSuccessorFormula x) env ↔ zeroOrSuccessor (env x) := by
119
- simp only [zeroOrSuccessorFormula, truth_disj, truth_emptyFormula, truth_exMem,
120
- truth_successorFormula]
121
- rfl
122
-
123
- theorem truth_naturalFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) :
124
- Truth (naturalFormula x) env ↔ env x ∈ ZFSet.omega := by
125
- simp only [naturalFormula, Truth, truth_setTransitiveFormula, truth_zeroOrSuccessorFormula]
126
- exact naturalSetProperty_iff_mem_omega (env x)
127
-
128
- theorem realize_naturalFormula (M : TransitiveGround.{u}) {n}
129
- (x : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) :
130
- Realize M.sets (naturalFormula x).toFormula env ↔ env x ∈ ZFSet.omega :=
131
- (realize_toFormula M _ env members).trans (truth_naturalFormula x env)
132
-
133
-
134
-
135
-
136
-
137
-
138
- theorem truth_singletonFormula {n} (z x : Fin n) (env : Fin n → ZFSet.{u}) :
139
- Truth (singletonFormula z x) env ↔ env z = {env x} := by
140
- change (env x ∈ env z ∧ ∀ w ∈ env z, w = env x) ↔ _
141
- constructor
142
- · rintro ⟨member, only⟩
143
- apply ZFSet.ext
144
- intro w
145
- rw [ZFSet.mem_singleton]
146
- exact ⟨only w, fun eq => eq.symm ▸ member⟩
147
- · intro eq
148
- rw [eq]
149
- exact ⟨ZFSet.mem_singleton.2 rfl, fun _ h => ZFSet.mem_singleton.1 h⟩
150
-
151
- theorem truth_unorderedPairFormula {n} (z x y : Fin n) (env : Fin n → ZFSet.{u}) :
152
- Truth (unorderedPairFormula z x y) env ↔ env z = {env x, env y} := by
153
- simp only [unorderedPairFormula, Truth, truth_disj]
154
- change (env x ∈ env z ∧ env y ∈ env z ∧ ∀ w ∈ env z, w = env x ∨ w = env y) ↔ _
155
- constructor
156
- · rintro ⟨hx, hy, only⟩
157
- apply ZFSet.ext
158
- intro w
159
- rw [ZFSet.mem_pair]
160
- refine ⟨only w, ?_⟩
161
- rintro (rfl | rfl)
162
- · exact hx
163
- · exact hy
164
- · intro eq
165
- rw [eq]
166
- exact ⟨ZFSet.mem_pair.2 (Or.inl rfl), ZFSet.mem_pair.2 (Or.inr rfl), fun _ h => ZFSet.mem_pair.1 h⟩
167
-
168
- theorem truth_orderedPairFormula {n} (z x y : Fin n) (env : Fin n → ZFSet.{u}) :
169
- Truth (orderedPairFormula z x y) env ↔ env z = ZFSet.pair (env x) (env y) := by
170
- rw [orderedPairFormula, truth_exMem]
171
- constructor
172
- · rintro ⟨a, _, first, rest⟩
173
- have ha := (truth_singletonFormula 0 x.succ (extend a env)).1 first
174
- obtain ⟨b, _, second, shape⟩ := (truth_exMem _ _ _).1 rest
175
- have hb := (truth_unorderedPairFormula 0 x.succ.succ y.succ.succ (extend b (extend a env))).1 second
176
- have hz := (truth_unorderedPairFormula z.succ.succ 1 0 (extend b (extend a env))).1 shape
177
- change a = {env x} at ha
178
- change b = {env x, env y} at hb
179
- change env z = {a, b} at hz
180
- rw [hz, ha, hb]
181
- rfl
182
- · intro eq
183
- have ha : ({env x} : ZFSet.{u}) ∈ env z := by
184
- rw [eq]
185
- exact ZFSet.mem_pair.2 (Or.inl rfl)
186
- refine ⟨{env x}, ha, (truth_singletonFormula 0 x.succ _).2 rfl, ?_⟩
187
- apply (truth_exMem _ _ _).2
188
- have hb : ({env x, env y} : ZFSet.{u}) ∈ env z := by
189
- rw [eq]
190
- exact ZFSet.mem_pair.2 (Or.inr rfl)
191
- exact ⟨{env x, env y}, hb, (truth_unorderedPairFormula 0 x.succ.succ y.succ.succ _).2 rfl,
192
- (truth_unorderedPairFormula z.succ.succ 1 0 _).2 eq⟩
193
-
194
- theorem truth_pairMembershipFormula {n} (x y r : Fin n) (env : Fin n → ZFSet.{u}) :
195
- Truth (pairMembershipFormula x y r) env ↔ ZFSet.pair (env x) (env y) ∈ env r := by
196
- rw [pairMembershipFormula, truth_exMem]
197
- constructor
198
- · rintro ⟨z, hz, shape⟩
199
- have eq := (truth_orderedPairFormula 0 x.succ y.succ (extend z env)).1 shape
200
- exact eq ▸ hz
201
- · intro member
202
- exact ⟨ZFSet.pair (env x) (env y), member, (truth_orderedPairFormula 0 x.succ y.succ _).2 rfl⟩
203
-
204
- end PartitionPilot.Forcing.BoundedFormula
205
-
206
-
207
-
208
- namespace PartitionPilot.Forcing
209
-
210
- universe u
211
-
212
- namespace SetFormula
213
-
214
- def exactSetFormula {n} (output : Fin n) (entry : SetFormula (n + 1)) : SetFormula n :=
215
- .all (.conj (imp (.mem 0 output.succ) entry) (imp entry (.mem 0 output.succ)))
216
-
217
- end SetFormula
218
-
219
- namespace TransitiveGround
220
-
221
- open SetFormula
222
- variable (M : TransitiveGround.{u})
223
-
224
- theorem realize_exactSetFormula {n} (output : Fin n) (entry : SetFormula (n + 1))
225
- (env : Fin n → ZFSet.{u}) {target : ZFSet.{u}}
226
- (hOutput : env output ∈ M.sets) (elements : ∀ z ∈ target, z ∈ M.sets)
227
- (meaning : ∀ z ∈ M.sets, Realize M.sets entry (extend z env) ↔ z ∈ target) :
228
- Realize M.sets (exactSetFormula output entry) env ↔ env output = target := by
229
- change (∀ z ∈ M.sets, Realize M.sets
230
- (.conj (imp (.mem 0 output.succ) entry) (imp entry (.mem 0 output.succ))) (extend z env)) ↔ _
231
- simp only [Realize, realize_imp]
232
- change (∀ z ∈ M.sets, (z ∈ env output → Realize M.sets entry (extend z env)) ∧
233
- (Realize M.sets entry (extend z env) → z ∈ env output)) ↔ _
234
- constructor
235
- · intro correct
236
- apply ZFSet.ext
237
- intro z
238
- constructor
239
- · intro member
240
- have hz := M.transitive hOutput member
241
- exact (meaning z hz).1 ((correct z hz).1 member)
242
- · intro member
243
- have hz := elements z member
244
- exact (correct z hz).2 ((meaning z hz).2 member)
245
- · intro equal z hz
246
- exact ⟨fun member => (meaning z hz).2 (equal ▸ member),
247
- fun predicate => equal.symm ▸ (meaning z hz).1 predicate⟩
248
-
249
- end TransitiveGround
250
-
251
- end PartitionPilot.Forcing
252
-
253
-
254
-
255
- namespace PartitionPilot.Forcing.BoundedFormula
256
-
257
- open SetFormula SetRealization
258
- universe u
259
-
260
- def ordinalFormula {n} (x : Fin n) : BoundedFormula n :=
261
- .conj (setTransitiveFormula x) (.allMem x (setTransitiveFormula 0))
262
-
263
- theorem truth_ordinalFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) :
264
- Truth (ordinalFormula x) env ↔ ∃ o : Ordinal.{u}, env x = ordinalCode o := by
265
- simp only [ordinalFormula, Truth, truth_setTransitiveFormula]
266
- exact ordinalSetProperty_iff (env x)
267
-
268
- theorem realize_ordinalFormula (M : TransitiveGround.{u}) {n}
269
- (x : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) :
270
- Realize M.sets (ordinalFormula x).toFormula env ↔ ∃ o : Ordinal.{u}, env x = ordinalCode o :=
271
- (realize_toFormula M _ env members).trans (truth_ordinalFormula x env)
272
-
273
- end PartitionPilot.Forcing.BoundedFormula
274
-
275
-
276
-
277
- namespace PartitionPilot.Forcing.BoundedFormula
278
- open SetFormula
279
- universe u
280
-
281
- def graphFiberInclusionFormula {n} (x y f g : Fin n) : BoundedFormula n :=
282
- .allMem f (.allMem 0 (.allMem 0
283
- (imp (orderedPairFormula 2 x.succ.succ.succ 0)
284
- (pairMembershipFormula y.succ.succ.succ 0 g.succ.succ.succ))))
285
-
286
- theorem truth_graphFiberInclusionFormula {n} (x y f g : Fin n)
287
- (env : Fin n → ZFSet.{u}) :
288
- Truth (graphFiberInclusionFormula x y f g) env ↔
289
- ∀ z, ZFSet.pair (env x) z ∈ env f → ZFSet.pair (env y) z ∈ env g := by
290
- simp only [graphFiberInclusionFormula, Truth, truth_imp,
291
- truth_orderedPairFormula, truth_pairMembershipFormula]
292
- change (∀ p ∈ env f, ∀ a ∈ p, ∀ z ∈ a,
293
- p = ZFSet.pair (env x) z → ZFSet.pair (env y) z ∈ env g) ↔ _
294
- constructor
295
- · intro h z entry
296
- exact h (ZFSet.pair (env x) z) entry {env x, z}
297
- (ZFSet.mem_pair.2 (Or.inr rfl)) z (ZFSet.mem_pair.2 (Or.inr rfl)) rfl
298
- · intro h p hp a _ z _ equal
299
- exact h z (equal ▸ hp)
300
-
301
- def graphFiberEqualityFormula {n} (x y f g : Fin n) : BoundedFormula n :=
302
- .conj (graphFiberInclusionFormula x y f g) (graphFiberInclusionFormula y x g f)
303
-
304
- theorem truth_graphFiberEqualityFormula {n} (x y f g : Fin n)
305
- (env : Fin n → ZFSet.{u}) :
306
- Truth (graphFiberEqualityFormula x y f g) env ↔
307
- ∀ z, ZFSet.pair (env x) z ∈ env f ↔ ZFSet.pair (env y) z ∈ env g := by
308
- simp only [graphFiberEqualityFormula, Truth, truth_graphFiberInclusionFormula]
309
- exact ⟨fun h z => ⟨h.1 z, h.2 z⟩, fun h => ⟨fun z => (h z).1, fun z => (h z).2⟩⟩
310
-
311
- end PartitionPilot.Forcing.BoundedFormula
312
-
313
-
314
-
315
- namespace PartitionPilot.Forcing
316
-
317
- universe u
318
-
319
- structure PartialOrderCode (Q R : ZFSet.{u}) : Prop where
320
- relation : R ⊆ ZFSet.prod Q Q
321
- refl : ∀ x ∈ Q, ZFSet.pair x x ∈ R
322
- antisymm : ∀ x ∈ Q, ∀ y ∈ Q, ZFSet.pair x y ∈ R → ZFSet.pair y x ∈ R → x = y
323
- trans : ∀ x ∈ Q, ∀ y ∈ Q, ∀ z ∈ Q,
324
- ZFSet.pair x y ∈ R → ZFSet.pair y z ∈ R → ZFSet.pair x z ∈ R
325
-
326
- namespace BoundedFormula
327
-
328
- open SetFormula
329
-
330
- def relationOnFormula {n} (c r : Fin n) : BoundedFormula n :=
331
- .allMem r (exMem c.succ (exMem c.succ.succ (orderedPairFormula 2 1 0)))
332
-
333
- def reflexiveFormula {n} (c r : Fin n) : BoundedFormula n :=
334
- .allMem c (pairMembershipFormula 0 0 r.succ)
335
-
336
- def antisymmetricFormula {n} (c r : Fin n) : BoundedFormula n :=
337
- .allMem c (.allMem c.succ (imp
338
- (.conj (pairMembershipFormula 1 0 r.succ.succ) (pairMembershipFormula 0 1 r.succ.succ)) (.equal 1 0)))
339
-
340
- def transitiveFormula {n} (c r : Fin n) : BoundedFormula n :=
341
- .allMem c (.allMem c.succ (.allMem c.succ.succ (imp
342
- (.conj (pairMembershipFormula 2 1 r.succ.succ.succ) (pairMembershipFormula 1 0 r.succ.succ.succ))
343
- (pairMembershipFormula 2 0 r.succ.succ.succ))))
344
-
345
- def partialOrderFormula {n} (c r : Fin n) : BoundedFormula n :=
346
- .conj (relationOnFormula c r) (.conj (reflexiveFormula c r)
347
- (.conj (antisymmetricFormula c r) (transitiveFormula c r)))
348
-
349
- def topFormula {n} (c r t : Fin n) : BoundedFormula n :=
350
- .conj (.mem t c) (.allMem c (pairMembershipFormula 0 t.succ r.succ))
351
-
352
- theorem truth_relationOnFormula {n} (c r : Fin n) (env : Fin n → ZFSet.{u}) :
353
- Truth (relationOnFormula c r) env ↔ env r ⊆ ZFSet.prod (env c) (env c) := by
354
- simp only [relationOnFormula, Truth, truth_exMem, truth_orderedPairFormula]
355
- exact forall_congr' (fun _ => forall_congr' (fun _ => ZFSet.mem_prod.symm))
356
-
357
- theorem truth_partialOrderFormula {n} (c r : Fin n) (env : Fin n → ZFSet.{u}) :
358
- Truth (partialOrderFormula c r) env ↔ PartialOrderCode (env c) (env r) := by
359
- simp only [partialOrderFormula, Truth, truth_relationOnFormula, reflexiveFormula,
360
- antisymmetricFormula, transitiveFormula, truth_imp, truth_pairMembershipFormula]
361
- constructor
362
- · rintro ⟨shape, refl, antisymm, trans⟩
363
- exact ⟨shape, refl, fun x hx y hy xy yx => antisymm x hx y hy ⟨xy, yx⟩,
364
- fun x hx y hy z hz xy yz => trans x hx y hy z hz ⟨xy, yz⟩⟩
365
- · intro h
366
- exact ⟨h.relation, h.refl, fun x hx y hy ⟨xy, yx⟩ => h.antisymm x hx y hy xy yx,
367
- fun x hx y hy z hz ⟨xy, yz⟩ => h.trans x hx y hy z hz xy yz⟩
368
-
369
- theorem truth_topFormula {n} (c r t : Fin n) (env : Fin n → ZFSet.{u}) :
370
- Truth (topFormula c r t) env ↔ env t ∈ env c ∧ ∀ x ∈ env c, ZFSet.pair x (env t) ∈ env r := by
371
- simp only [topFormula, Truth, truth_pairMembershipFormula]
372
- rfl
373
-
374
- end BoundedFormula
375
-
376
- namespace TransitiveGround
377
-
378
- open SetFormula
379
- variable (M : TransitiveGround.{u})
380
-
381
- theorem realize_partialOrderCode {Q R : ZFSet.{u}} (hQ : Q ∈ M.sets) (hR : R ∈ M.sets) :
382
- Realize M.sets (BoundedFormula.partialOrderFormula 0 1).toFormula (extend Q (extend R Fin.elim0)) ↔
383
- PartialOrderCode Q R :=
384
- (BoundedFormula.realize_toFormula M _ _ (Fin.cases hQ (Fin.cases hR (fun i => Fin.elim0 i)))).trans
385
- (BoundedFormula.truth_partialOrderFormula 0 1 _)
386
-
387
- theorem partialOrderCode_absolute (N : TransitiveGround.{u}) {Q R : ZFSet.{u}}
388
- (hQM : Q ∈ M.sets) (hRM : R ∈ M.sets) (hQN : Q ∈ N.sets) (hRN : R ∈ N.sets) :
389
- Realize M.sets (BoundedFormula.partialOrderFormula 0 1).toFormula (extend Q (extend R Fin.elim0)) ↔
390
- Realize N.sets (BoundedFormula.partialOrderFormula 0 1).toFormula (extend Q (extend R Fin.elim0)) :=
391
- (M.realize_partialOrderCode hQM hRM).trans (N.realize_partialOrderCode hQN hRN).symm
392
-
393
- end TransitiveGround
394
-
395
- end PartitionPilot.Forcing
396
-
397
-
398
-
399
- namespace PartitionPilot.Forcing.BoundedFormula
400
-
401
- open SetFormula
402
- universe u
403
-
404
- def orderedTripleFormula {n} (w x y z : Fin n) : BoundedFormula n :=
405
- exMem w (exMem 0 (.conj (orderedPairFormula 0 x.succ.succ y.succ.succ)
406
- (orderedPairFormula w.succ.succ 0 z.succ.succ)))
407
-
408
- def tripleMembershipFormula {n} (x y z f : Fin n) : BoundedFormula n :=
409
- exMem f (orderedTripleFormula 0 x.succ y.succ z.succ)
410
-
411
- theorem truth_orderedTripleFormula {n} (w x y z : Fin n) (env : Fin n → ZFSet.{u}) :
412
- Truth (orderedTripleFormula w x y z) env ↔
413
- env w = ZFSet.pair (ZFSet.pair (env x) (env y)) (env z) := by
414
- simp only [orderedTripleFormula, truth_exMem, Truth, truth_orderedPairFormula]
415
- change (∃ a ∈ env w, ∃ b ∈ a, b = ZFSet.pair (env x) (env y) ∧
416
- env w = ZFSet.pair b (env z)) ↔ _
417
- constructor
418
- · rintro ⟨a, _, b, _, rfl, eq⟩
419
- exact eq
420
- · intro eq
421
- refine ⟨{ZFSet.pair (env x) (env y)}, ?_, ZFSet.pair (env x) (env y),
422
- ZFSet.mem_singleton.2 rfl, rfl, eq⟩
423
- rw [eq]
424
- exact ZFSet.mem_pair.2 (Or.inl rfl)
425
-
426
- theorem truth_tripleMembershipFormula {n} (x y z f : Fin n) (env : Fin n → ZFSet.{u}) :
427
- Truth (tripleMembershipFormula x y z f) env ↔
428
- ZFSet.pair (ZFSet.pair (env x) (env y)) (env z) ∈ env f := by
429
- simp only [tripleMembershipFormula, truth_exMem, truth_orderedTripleFormula]
430
- change (∃ w ∈ env f, w = ZFSet.pair (ZFSet.pair (env x) (env y)) (env z)) ↔ _
431
- exact ⟨fun ⟨_, hw, eq⟩ => eq ▸ hw, fun hw => ⟨_, hw, rfl⟩⟩
432
-
433
- end PartitionPilot.Forcing.BoundedFormula
434
-
435
-
436
- section
437
-
438
- namespace PartitionPilot.Forcing.BoundedFormula
439
-
440
- open SetFormula
441
- universe u
442
-
443
- theorem truth_relationBetweenFormula {n} (a b f : Fin n) (env : Fin n → ZFSet.{u}) :
444
- Truth (relationBetweenFormula a b f) env ↔ env f ⊆ ZFSet.prod (env a) (env b) := by
445
- simp only [relationBetweenFormula, Truth, truth_exMem, truth_orderedPairFormula]
446
- exact forall_congr' (fun _ => forall_congr' (fun _ => ZFSet.mem_prod.symm))
447
-
448
- theorem truth_functionFormula {n} (a b f : Fin n) (env : Fin n → ZFSet.{u}) :
449
- Truth (functionFormula a b f) env ↔ ZFSet.IsFunc (env a) (env b) (env f) := by
450
- simp only [functionFormula, Truth, truth_relationBetweenFormula, truth_exMem,
451
- truth_pairMembershipFormula, truth_imp]
452
- constructor
453
- · rintro ⟨shape, total⟩
454
- refine ⟨shape, ?_⟩
455
- intro x hx
456
- obtain ⟨y, _, pair, unique⟩ := total x hx
457
- refine ⟨y, pair, ?_⟩
458
- intro z rel
459
- exact unique z (ZFSet.pair_mem_prod.1 (shape rel)).2 rel
460
- · rintro ⟨shape, total⟩
461
- refine ⟨shape, ?_⟩
462
- intro x hx
463
- obtain ⟨y, rel, unique⟩ := total x hx
464
- exact ⟨y, (ZFSet.pair_mem_prod.1 (shape rel)).2, rel, fun z _ hz => unique z hz⟩
465
-
466
- end PartitionPilot.Forcing.BoundedFormula
467
-
468
- namespace PartitionPilot.Forcing.TransitiveGround
469
-
470
- open SetFormula
471
- universe u
472
- variable (M : TransitiveGround.{u})
473
-
474
- theorem realize_functionCode {A B f : ZFSet.{u}}
475
- (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hf : f ∈ M.sets) :
476
- Realize M.sets (BoundedFormula.functionFormula 0 1 2).toFormula
477
- (extend A (extend B (extend f Fin.elim0))) ↔ ZFSet.IsFunc A B f :=
478
- (BoundedFormula.realize_toFormula M _ _ (Fin.cases hA (Fin.cases hB (Fin.cases hf (fun i => Fin.elim0 i))))).trans
479
- (BoundedFormula.truth_functionFormula 0 1 2 _)
480
-
481
- end PartitionPilot.Forcing.TransitiveGround
482
-
483
- end
484
-
485
-
486
- namespace PartitionPilot.Forcing.BoundedFormula
487
-
488
- open SetFormula
489
- universe u
490
-
491
- def nestedActionTripleFormula {n} (z g a b c d : Fin n) : BoundedFormula n :=
492
- let lift4 (j : Fin n) := j.succ.succ.succ.succ
493
- let lift6 (j : Fin n) := j.succ.succ.succ.succ.succ.succ
494
- exMem z (exMem 0 (exMem z.succ.succ (exMem 0
495
- (.conj (orderedPairFormula (lift4 z) 2 0)
496
- (.conj (orderedPairFormula 0 (lift4 c) (lift4 d))
497
- (exMem 2 (exMem 0 (.conj (orderedPairFormula 4 (lift6 g) 0)
498
- (orderedPairFormula 0 (lift6 a) (lift6 b))))))))))
499
-
500
- theorem truth_nestedActionTripleFormula {n} (z g a b c d : Fin n)
501
- (env : Fin n → ZFSet.{u}) :
502
- Truth (nestedActionTripleFormula z g a b c d) env ↔
503
- env z = ZFSet.pair (ZFSet.pair (env g) (ZFSet.pair (env a) (env b)))
504
- (ZFSet.pair (env c) (env d)) := by
505
- simp only [nestedActionTripleFormula, truth_exMem, Truth, truth_orderedPairFormula]
506
- change (∃ s ∈ env z, ∃ x ∈ s, ∃ t ∈ env z, ∃ y ∈ t,
507
- env z = ZFSet.pair x y ∧ y = ZFSet.pair (env c) (env d) ∧
508
- ∃ w ∈ x, ∃ v ∈ w, x = ZFSet.pair (env g) v ∧ v = ZFSet.pair (env a) (env b)) ↔ _
509
- constructor
510
- · rintro ⟨_, _, x, _, _, _, y, _, outer, hy, _, _, v, _, hx, hv⟩
511
- rw [outer, hy, hx, hv]
512
- · intro equal
513
- let v := ZFSet.pair (env a) (env b)
514
- let x := ZFSet.pair (env g) v
515
- let y := ZFSet.pair (env c) (env d)
516
- refine ⟨{x}, ?_, x, ZFSet.mem_singleton.2 rfl, {x, y}, ?_, y,
517
- ZFSet.mem_pair.2 (Or.inr rfl), equal, rfl, {env g, v},
518
- ZFSet.mem_pair.2 (Or.inr rfl), v, ZFSet.mem_pair.2 (Or.inr rfl), rfl, rfl⟩
519
- · rw [equal]
520
- exact ZFSet.mem_pair.2 (Or.inl rfl)
521
- · rw [equal]
522
- exact ZFSet.mem_pair.2 (Or.inr rfl)
523
-
524
-
525
-
526
-
527
-
528
-
529
- def binaryRelationFormula {n} (g f : Fin n) : BoundedFormula n :=
530
- .allMem f (exMem g.succ (exMem g.succ.succ
531
- (exMem g.succ.succ.succ (orderedTripleFormula 3 2 1 0))))
532
-
533
- def binaryFunctionFormula {n} (g f : Fin n) : BoundedFormula n :=
534
- .conj (binaryRelationFormula g f) (.allMem g (.allMem g.succ
535
- (exMem g.succ.succ (.conj (tripleMembershipFormula 2 1 0 f.succ.succ.succ)
536
- (.allMem g.succ.succ.succ (imp
537
- (tripleMembershipFormula 3 2 0 f.succ.succ.succ.succ) (.equal 0 1)))))))
538
-
539
- theorem truth_binaryRelationFormula {n} (g f : Fin n) (env : Fin n → ZFSet.{u}) :
540
- Truth (binaryRelationFormula g f) env ↔
541
- env f ⊆ ZFSet.prod (ZFSet.prod (env g) (env g)) (env g) := by
542
- simp only [binaryRelationFormula, Truth, truth_exMem, truth_orderedTripleFormula]
543
- constructor
544
- · intro h w hw
545
- obtain ⟨x, hx, y, hy, z, hz, eq⟩ := h w hw
546
- exact ZFSet.mem_prod.2 ⟨ZFSet.pair x y, ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, z, hz, eq⟩
547
- · intro h w hw
548
- obtain ⟨xy, hxy, z, hz, eq⟩ := ZFSet.mem_prod.1 (h hw)
549
- obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy
550
- exact ⟨x, hx, y, hy, z, hz, eq⟩
551
-
552
- theorem truth_binaryFunctionFormula {n} (g f : Fin n) (env : Fin n → ZFSet.{u}) :
553
- Truth (binaryFunctionFormula g f) env ↔
554
- ZFSet.IsFunc (ZFSet.prod (env g) (env g)) (env g) (env f) := by
555
- simp only [binaryFunctionFormula, Truth, truth_binaryRelationFormula, truth_exMem,
556
- truth_tripleMembershipFormula, truth_imp]
557
- constructor
558
- · rintro ⟨shape, total⟩
559
- refine ⟨shape, ?_⟩
560
- intro xy hxy
561
- obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy
562
- obtain ⟨z, _, rel, unique⟩ := total x hx y hy
563
- refine ⟨z, rel, ?_⟩
564
- intro w hw
565
- exact unique w (ZFSet.pair_mem_prod.1 (shape hw)).2 hw
566
- · rintro ⟨shape, total⟩
567
- refine ⟨shape, ?_⟩
568
- intro x hx y hy
569
- obtain ⟨z, rel, unique⟩ := total (ZFSet.pair x y) (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩)
570
- exact ⟨z, (ZFSet.pair_mem_prod.1 (shape rel)).2, rel, fun w _ hw => unique w hw⟩
571
-
572
- end PartitionPilot.Forcing.BoundedFormula
573
-
574
-
575
-
576
- namespace PartitionPilot.Forcing
577
-
578
- universe u
579
-
580
- structure GroupCode (G m i e : ZFSet.{u}) : Prop where
581
- mul_function : ZFSet.IsFunc (ZFSet.prod G G) G m
582
- inv_function : ZFSet.IsFunc G G i
583
- identity_mem : e ∈ G
584
- one_mul : ∀ x ∈ G, ZFSet.pair (ZFSet.pair e x) x ∈ m
585
- mul_one : ∀ x ∈ G, ZFSet.pair (ZFSet.pair x e) x ∈ m
586
- inv_mul : ∀ x ∈ G, ∀ y ∈ G, ZFSet.pair x y ∈ i → ZFSet.pair (ZFSet.pair y x) e ∈ m
587
- mul_assoc : ∀ x ∈ G, ∀ y ∈ G, ∀ z ∈ G, ∀ a ∈ G, ∀ b ∈ G, ∀ c ∈ G,
588
- ZFSet.pair (ZFSet.pair x y) a ∈ m → ZFSet.pair (ZFSet.pair y z) b ∈ m →
589
- ZFSet.pair (ZFSet.pair a z) c ∈ m → ZFSet.pair (ZFSet.pair x b) c ∈ m
590
-
591
- namespace BoundedFormula
592
-
593
- open SetFormula
594
-
595
- def groupIdentityFormula {n} (g m e : Fin n) : BoundedFormula n :=
596
- .allMem g (.conj (tripleMembershipFormula e.succ 0 0 m.succ)
597
- (tripleMembershipFormula 0 e.succ 0 m.succ))
598
-
599
- def groupInverseFormula {n} (g m i e : Fin n) : BoundedFormula n :=
600
- .allMem g (.allMem g.succ (imp (pairMembershipFormula 1 0 i.succ.succ)
601
- (tripleMembershipFormula 0 1 e.succ.succ m.succ.succ)))
602
-
603
- def groupAssociativeFormula {n} (g m : Fin n) : BoundedFormula n :=
604
- .allMem g (.allMem g.succ (.allMem g.succ.succ (.allMem g.succ.succ.succ
605
- (.allMem g.succ.succ.succ.succ (.allMem g.succ.succ.succ.succ.succ
606
- (imp (.conj (tripleMembershipFormula 5 4 2 m.succ.succ.succ.succ.succ.succ)
607
- (.conj (tripleMembershipFormula 4 3 1 m.succ.succ.succ.succ.succ.succ)
608
- (tripleMembershipFormula 2 3 0 m.succ.succ.succ.succ.succ.succ)))
609
- (tripleMembershipFormula 5 1 0 m.succ.succ.succ.succ.succ.succ)))))))
610
-
611
- def groupFormula {n} (g m i e : Fin n) : BoundedFormula n :=
612
- .conj (binaryFunctionFormula g m) (.conj (functionFormula g g i)
613
- (.conj (.mem e g) (.conj (groupIdentityFormula g m e)
614
- (.conj (groupInverseFormula g m i e) (groupAssociativeFormula g m)))))
615
-
616
- theorem truth_groupFormula {n} (g m i e : Fin n) (env : Fin n → ZFSet.{u}) :
617
- Truth (groupFormula g m i e) env ↔ GroupCode (env g) (env m) (env i) (env e) := by
618
- simp only [groupFormula, Truth, truth_binaryFunctionFormula, truth_functionFormula,
619
- groupIdentityFormula, groupInverseFormula, groupAssociativeFormula,
620
- truth_tripleMembershipFormula, truth_pairMembershipFormula, truth_imp]
621
- constructor
622
- · rintro ⟨mul, inv, one, identity, inverse, assoc⟩
623
- exact ⟨mul, inv, one, fun x hx => (identity x hx).1,
624
- fun x hx => (identity x hx).2, inverse,
625
- fun x hx y hy z hz a ha b hb c hc xy yz az => assoc x hx y hy z hz a ha b hb c hc ⟨xy, yz, az⟩⟩
626
- · intro h
627
- exact ⟨h.mul_function, h.inv_function, h.identity_mem,
628
- fun x hx => ⟨h.one_mul x hx, h.mul_one x hx⟩, h.inv_mul,
629
- fun x hx y hy z hz a ha b hb c hc ⟨xy, yz, az⟩ => h.mul_assoc x hx y hy z hz a ha b hb c hc xy yz az⟩
630
-
631
- end BoundedFormula
632
-
633
- namespace TransitiveGround
634
-
635
- open SetFormula
636
- variable (M : TransitiveGround.{u})
637
-
638
- theorem realize_groupCode {G m i e : ZFSet.{u}}
639
- (hG : G ∈ M.sets) (hm : m ∈ M.sets) (hi : i ∈ M.sets) (he : e ∈ M.sets) :
640
- Realize M.sets (BoundedFormula.groupFormula 0 1 2 3).toFormula
641
- (extend G (extend m (extend i (extend e Fin.elim0)))) ↔ GroupCode G m i e :=
642
- (BoundedFormula.realize_toFormula M _ _
643
- (Fin.cases hG (Fin.cases hm (Fin.cases hi (Fin.cases he (fun j => Fin.elim0 j)))))).trans
644
- (BoundedFormula.truth_groupFormula 0 1 2 3 _)
645
-
646
- end TransitiveGround
647
-
648
- end PartitionPilot.Forcing
649
-
650
-
651
-
652
- namespace PartitionPilot.SetRealization.Presentation
653
- open Forcing
654
- universe u
655
- variable {G : Type u} [Group G] (s : Presentation G)
656
-
657
- theorem groupCode : GroupCode s.carrier
658
- ((s.product s).graph s (fun xy => xy.1 * xy.2))
659
- (s.graph s (fun x => x⁻¹)) (s.encode 1) := by
660
- refine ⟨(s.product s).graph_isFunc s _, s.graph_isFunc s _, s.encode_mem 1, ?_, ?_, ?_, ?_⟩
661
- · intro x hx
662
- obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx
663
- exact ((s.product s).pair_mem_graph s _ (1, a) a).2 (one_mul a)
664
- · intro x hx
665
- obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx
666
- exact ((s.product s).pair_mem_graph s _ (a, 1) a).2 (mul_one a)
667
- · intro x hx y hy entry
668
- obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx
669
- obtain ⟨b, rfl⟩ := (s.mem_carrier y).1 hy
670
- have inverse := (s.pair_mem_graph s _ a b).1 entry
671
- apply ((s.product s).pair_mem_graph s _ (b, a) 1).2
672
- rw [← inverse, inv_mul_cancel]
673
- · intro x hx y hy z hz a ha b hb c hc xy yz az
674
- obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx
675
- obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy
676
- obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz
677
- obtain ⟨a, rfl⟩ := (s.mem_carrier a).1 ha
678
- obtain ⟨b, rfl⟩ := (s.mem_carrier b).1 hb
679
- obtain ⟨c, rfl⟩ := (s.mem_carrier c).1 hc
680
- have first := ((s.product s).pair_mem_graph s _ (x, y) a).1 xy
681
- have second := ((s.product s).pair_mem_graph s _ (y, z) b).1 yz
682
- have third := ((s.product s).pair_mem_graph s _ (a, z) c).1 az
683
- apply ((s.product s).pair_mem_graph s _ (x, b) c).2
684
- rw [← second, ← mul_assoc, first, third]
685
-
686
- end PartitionPilot.SetRealization.Presentation
687
-
688
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Definability.UnionEntryFormula
2
+ import OAI.SetTheory.PartitionPrinciple.Transfinite.OrdinalRecursionTraces
3
+
4
+ namespace OAI
5
+
6
+
7
+ namespace PartitionPilot.Forcing
8
+
9
+ namespace BoundedFormula
10
+
11
+ open SetFormula
12
+ universe u
13
+
14
+ def Truth : {n : Nat} → BoundedFormula n → (Fin n → ZFSet.{u}) → Prop
15
+ | _, .equal i j, env => env i = env j
16
+ | _, .mem i j, env => env i ∈ env j
17
+ | _, .neg φ, env => ¬ Truth φ env
18
+ | _, .conj φ ψ, env => Truth φ env ∧ Truth ψ env
19
+ | _, .allMem b φ, env => ∀ x ∈ env b, Truth φ (extend x env)
20
+
21
+ theorem truth_imp {n} (φ ψ : BoundedFormula n) (env : Fin n → ZFSet.{u}) :
22
+ Truth (imp φ ψ) env ↔ (Truth φ env → Truth ψ env) := by
23
+ classical
24
+ simp only [imp, Truth, not_and, not_not]
25
+
26
+ theorem truth_disj {n} (φ ψ : BoundedFormula n) (env : Fin n → ZFSet.{u}) :
27
+ Truth (disj φ ψ) env ↔ (Truth φ env ∨ Truth ψ env) := by
28
+ classical
29
+ simp only [disj, Truth, not_and_or, not_not]
30
+
31
+ theorem truth_exMem {n} (b : Fin n) (φ : BoundedFormula (n + 1)) (env : Fin n → ZFSet.{u}) :
32
+ Truth (exMem b φ) env ↔ ∃ x ∈ env b, Truth φ (extend x env) := by
33
+ classical
34
+ simp only [exMem, Truth, not_forall, not_not, exists_prop]
35
+
36
+ theorem realize_toFormula (M : TransitiveGround.{u}) {n} (φ : BoundedFormula n)
37
+ (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) :
38
+ Realize M.sets φ.toFormula env ↔ Truth φ env := by
39
+ induction φ with
40
+ | equal i j => rfl
41
+ | mem i j => rfl
42
+ | neg φ ih => exact not_congr (ih env members)
43
+ | conj φ ψ ihφ ihψ => exact and_congr (ihφ env members) (ihψ env members)
44
+ | allMem b φ ih =>
45
+ change (∀ x ∈ M.sets, Realize M.sets (SetFormula.imp (.mem 0 b.succ) φ.toFormula) (extend x env)) ↔ _
46
+ constructor
47
+ · intro h x hx
48
+ have hxM := M.transitive (members b) hx
49
+ exact (ih (extend x env) (Fin.cases hxM members)).1
50
+ ((realize_imp M.sets _ _ _).1 (h x hxM) hx)
51
+ · intro h x hxM
52
+ apply (realize_imp M.sets _ _ _).2
53
+ intro hx
54
+ exact (ih (extend x env) (Fin.cases hxM members)).2 (h x hx)
55
+
56
+ theorem absolute (M N : TransitiveGround.{u}) {n} (φ : BoundedFormula n)
57
+ (env : Fin n → ZFSet.{u}) (inM : ∀ i, env i ∈ M.sets) (inN : ∀ i, env i ∈ N.sets) :
58
+ Realize M.sets φ.toFormula env ↔ Realize N.sets φ.toFormula env :=
59
+ (realize_toFormula M φ env inM).trans (realize_toFormula N φ env inN).symm
60
+
61
+ end BoundedFormula
62
+
63
+ end PartitionPilot.Forcing
64
+
65
+
66
+
67
+ namespace PartitionPilot.Forcing.BoundedFormula
68
+
69
+ open SetFormula
70
+ universe u
71
+
72
+ def emptyFormula {n} (x : Fin n) : BoundedFormula n :=
73
+ .allMem x (.neg (.equal 0 0))
74
+
75
+ def successorFormula {n} (y x : Fin n) : BoundedFormula n :=
76
+ .conj (.mem x y) (.conj (.allMem x (.mem 0 y.succ))
77
+ (.allMem y (disj (.equal 0 x.succ) (.mem 0 x.succ))))
78
+
79
+ def setTransitiveFormula {n} (x : Fin n) : BoundedFormula n :=
80
+ .allMem x (.allMem 0 (.mem 0 x.succ.succ))
81
+
82
+ def zeroOrSuccessorFormula {n} (x : Fin n) : BoundedFormula n :=
83
+ disj (emptyFormula x) (exMem x (successorFormula x.succ 0))
84
+
85
+ def naturalFormula {n} (x : Fin n) : BoundedFormula n :=
86
+ .conj (setTransitiveFormula x) (.conj (zeroOrSuccessorFormula x)
87
+ (.allMem x (.conj (setTransitiveFormula 0) (zeroOrSuccessorFormula 0))))
88
+
89
+ theorem truth_emptyFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) :
90
+ Truth (emptyFormula x) env ↔ env x = ∅ := by
91
+ change (∀ y ∈ env x, ¬ y = y) ↔ _
92
+ constructor
93
+ · intro h
94
+ exact (ZFSet.eq_empty _).2 (fun y hy => h y hy rfl)
95
+ · intro h y hy
96
+ exact False.elim ((ZFSet.eq_empty _).1 h y hy)
97
+
98
+ theorem truth_successorFormula {n} (y x : Fin n) (env : Fin n → ZFSet.{u}) :
99
+ Truth (successorFormula y x) env ↔ env y = insert (env x) (env x) := by
100
+ simp only [successorFormula, Truth, truth_disj]
101
+ change (env x ∈ env y ∧ (∀ z ∈ env x, z ∈ env y) ∧
102
+ ∀ z ∈ env y, z = env x ∨ z ∈ env x) ↔ _
103
+ constructor
104
+ · rintro ⟨hx, lower, upper⟩
105
+ apply ZFSet.ext
106
+ intro z
107
+ rw [ZFSet.mem_insert_iff]
108
+ exact ⟨upper z, fun h => h.elim (fun eq => eq.symm ▸ hx) (lower z)⟩
109
+ · intro eq
110
+ rw [eq]
111
+ exact ⟨ZFSet.mem_insert _ _, fun _ hz => ZFSet.mem_insert_of_mem _ hz,
112
+ fun _ hz => ZFSet.mem_insert_iff.1 hz⟩
113
+
114
+ theorem truth_setTransitiveFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) :
115
+ Truth (setTransitiveFormula x) env ↔ setTransitive (env x) := Iff.rfl
116
+
117
+ theorem truth_zeroOrSuccessorFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) :
118
+ Truth (zeroOrSuccessorFormula x) env ↔ zeroOrSuccessor (env x) := by
119
+ simp only [zeroOrSuccessorFormula, truth_disj, truth_emptyFormula, truth_exMem,
120
+ truth_successorFormula]
121
+ rfl
122
+
123
+ theorem truth_naturalFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) :
124
+ Truth (naturalFormula x) env ↔ env x ∈ ZFSet.omega := by
125
+ simp only [naturalFormula, Truth, truth_setTransitiveFormula, truth_zeroOrSuccessorFormula]
126
+ exact naturalSetProperty_iff_mem_omega (env x)
127
+
128
+ theorem realize_naturalFormula (M : TransitiveGround.{u}) {n}
129
+ (x : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) :
130
+ Realize M.sets (naturalFormula x).toFormula env ↔ env x ∈ ZFSet.omega :=
131
+ (realize_toFormula M _ env members).trans (truth_naturalFormula x env)
132
+
133
+
134
+
135
+
136
+
137
+
138
+ theorem truth_singletonFormula {n} (z x : Fin n) (env : Fin n → ZFSet.{u}) :
139
+ Truth (singletonFormula z x) env ↔ env z = {env x} := by
140
+ change (env x ∈ env z ∧ ∀ w ∈ env z, w = env x) ↔ _
141
+ constructor
142
+ · rintro ⟨member, only⟩
143
+ apply ZFSet.ext
144
+ intro w
145
+ rw [ZFSet.mem_singleton]
146
+ exact ⟨only w, fun eq => eq.symm ▸ member⟩
147
+ · intro eq
148
+ rw [eq]
149
+ exact ⟨ZFSet.mem_singleton.2 rfl, fun _ h => ZFSet.mem_singleton.1 h⟩
150
+
151
+ theorem truth_unorderedPairFormula {n} (z x y : Fin n) (env : Fin n → ZFSet.{u}) :
152
+ Truth (unorderedPairFormula z x y) env ↔ env z = {env x, env y} := by
153
+ simp only [unorderedPairFormula, Truth, truth_disj]
154
+ change (env x ∈ env z ∧ env y ∈ env z ∧ ∀ w ∈ env z, w = env x ∨ w = env y) ↔ _
155
+ constructor
156
+ · rintro ⟨hx, hy, only⟩
157
+ apply ZFSet.ext
158
+ intro w
159
+ rw [ZFSet.mem_pair]
160
+ refine ⟨only w, ?_⟩
161
+ rintro (rfl | rfl)
162
+ · exact hx
163
+ · exact hy
164
+ · intro eq
165
+ rw [eq]
166
+ exact ⟨ZFSet.mem_pair.2 (Or.inl rfl), ZFSet.mem_pair.2 (Or.inr rfl), fun _ h => ZFSet.mem_pair.1 h⟩
167
+
168
+ theorem truth_orderedPairFormula {n} (z x y : Fin n) (env : Fin n → ZFSet.{u}) :
169
+ Truth (orderedPairFormula z x y) env ↔ env z = ZFSet.pair (env x) (env y) := by
170
+ rw [orderedPairFormula, truth_exMem]
171
+ constructor
172
+ · rintro ⟨a, _, first, rest⟩
173
+ have ha := (truth_singletonFormula 0 x.succ (extend a env)).1 first
174
+ obtain ⟨b, _, second, shape⟩ := (truth_exMem _ _ _).1 rest
175
+ have hb := (truth_unorderedPairFormula 0 x.succ.succ y.succ.succ (extend b (extend a env))).1 second
176
+ have hz := (truth_unorderedPairFormula z.succ.succ 1 0 (extend b (extend a env))).1 shape
177
+ change a = {env x} at ha
178
+ change b = {env x, env y} at hb
179
+ change env z = {a, b} at hz
180
+ rw [hz, ha, hb]
181
+ rfl
182
+ · intro eq
183
+ have ha : ({env x} : ZFSet.{u}) ∈ env z := by
184
+ rw [eq]
185
+ exact ZFSet.mem_pair.2 (Or.inl rfl)
186
+ refine ⟨{env x}, ha, (truth_singletonFormula 0 x.succ _).2 rfl, ?_⟩
187
+ apply (truth_exMem _ _ _).2
188
+ have hb : ({env x, env y} : ZFSet.{u}) ∈ env z := by
189
+ rw [eq]
190
+ exact ZFSet.mem_pair.2 (Or.inr rfl)
191
+ exact ⟨{env x, env y}, hb, (truth_unorderedPairFormula 0 x.succ.succ y.succ.succ _).2 rfl,
192
+ (truth_unorderedPairFormula z.succ.succ 1 0 _).2 eq⟩
193
+
194
+ theorem truth_pairMembershipFormula {n} (x y r : Fin n) (env : Fin n → ZFSet.{u}) :
195
+ Truth (pairMembershipFormula x y r) env ↔ ZFSet.pair (env x) (env y) ∈ env r := by
196
+ rw [pairMembershipFormula, truth_exMem]
197
+ constructor
198
+ · rintro ⟨z, hz, shape⟩
199
+ have eq := (truth_orderedPairFormula 0 x.succ y.succ (extend z env)).1 shape
200
+ exact eq ▸ hz
201
+ · intro member
202
+ exact ⟨ZFSet.pair (env x) (env y), member, (truth_orderedPairFormula 0 x.succ y.succ _).2 rfl⟩
203
+
204
+ end PartitionPilot.Forcing.BoundedFormula
205
+
206
+
207
+
208
+ namespace PartitionPilot.Forcing
209
+
210
+ universe u
211
+
212
+ namespace SetFormula
213
+
214
+ def exactSetFormula {n} (output : Fin n) (entry : SetFormula (n + 1)) : SetFormula n :=
215
+ .all (.conj (imp (.mem 0 output.succ) entry) (imp entry (.mem 0 output.succ)))
216
+
217
+ end SetFormula
218
+
219
+ namespace TransitiveGround
220
+
221
+ open SetFormula
222
+ variable (M : TransitiveGround.{u})
223
+
224
+ theorem realize_exactSetFormula {n} (output : Fin n) (entry : SetFormula (n + 1))
225
+ (env : Fin n → ZFSet.{u}) {target : ZFSet.{u}}
226
+ (hOutput : env output ∈ M.sets) (elements : ∀ z ∈ target, z ∈ M.sets)
227
+ (meaning : ∀ z ∈ M.sets, Realize M.sets entry (extend z env) ↔ z ∈ target) :
228
+ Realize M.sets (exactSetFormula output entry) env ↔ env output = target := by
229
+ change (∀ z ∈ M.sets, Realize M.sets
230
+ (.conj (imp (.mem 0 output.succ) entry) (imp entry (.mem 0 output.succ))) (extend z env)) ↔ _
231
+ simp only [Realize, realize_imp]
232
+ change (∀ z ∈ M.sets, (z ∈ env output → Realize M.sets entry (extend z env)) ∧
233
+ (Realize M.sets entry (extend z env) → z ∈ env output)) ↔ _
234
+ constructor
235
+ · intro correct
236
+ apply ZFSet.ext
237
+ intro z
238
+ constructor
239
+ · intro member
240
+ have hz := M.transitive hOutput member
241
+ exact (meaning z hz).1 ((correct z hz).1 member)
242
+ · intro member
243
+ have hz := elements z member
244
+ exact (correct z hz).2 ((meaning z hz).2 member)
245
+ · intro equal z hz
246
+ exact ⟨fun member => (meaning z hz).2 (equal ▸ member),
247
+ fun predicate => equal.symm ▸ (meaning z hz).1 predicate⟩
248
+
249
+ end TransitiveGround
250
+
251
+ end PartitionPilot.Forcing
252
+
253
+
254
+
255
+ namespace PartitionPilot.Forcing.BoundedFormula
256
+
257
+ open SetFormula SetRealization
258
+ universe u
259
+
260
+ def ordinalFormula {n} (x : Fin n) : BoundedFormula n :=
261
+ .conj (setTransitiveFormula x) (.allMem x (setTransitiveFormula 0))
262
+
263
+ theorem truth_ordinalFormula {n} (x : Fin n) (env : Fin n → ZFSet.{u}) :
264
+ Truth (ordinalFormula x) env ↔ ∃ o : Ordinal.{u}, env x = ordinalCode o := by
265
+ simp only [ordinalFormula, Truth, truth_setTransitiveFormula]
266
+ exact ordinalSetProperty_iff (env x)
267
+
268
+ theorem realize_ordinalFormula (M : TransitiveGround.{u}) {n}
269
+ (x : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) :
270
+ Realize M.sets (ordinalFormula x).toFormula env ↔ ∃ o : Ordinal.{u}, env x = ordinalCode o :=
271
+ (realize_toFormula M _ env members).trans (truth_ordinalFormula x env)
272
+
273
+ end PartitionPilot.Forcing.BoundedFormula
274
+
275
+
276
+
277
+ namespace PartitionPilot.Forcing.BoundedFormula
278
+ open SetFormula
279
+ universe u
280
+
281
+ def graphFiberInclusionFormula {n} (x y f g : Fin n) : BoundedFormula n :=
282
+ .allMem f (.allMem 0 (.allMem 0
283
+ (imp (orderedPairFormula 2 x.succ.succ.succ 0)
284
+ (pairMembershipFormula y.succ.succ.succ 0 g.succ.succ.succ))))
285
+
286
+ theorem truth_graphFiberInclusionFormula {n} (x y f g : Fin n)
287
+ (env : Fin n → ZFSet.{u}) :
288
+ Truth (graphFiberInclusionFormula x y f g) env ↔
289
+ ∀ z, ZFSet.pair (env x) z ∈ env f → ZFSet.pair (env y) z ∈ env g := by
290
+ simp only [graphFiberInclusionFormula, Truth, truth_imp,
291
+ truth_orderedPairFormula, truth_pairMembershipFormula]
292
+ change (∀ p ∈ env f, ∀ a ∈ p, ∀ z ∈ a,
293
+ p = ZFSet.pair (env x) z → ZFSet.pair (env y) z ∈ env g) ↔ _
294
+ constructor
295
+ · intro h z entry
296
+ exact h (ZFSet.pair (env x) z) entry {env x, z}
297
+ (ZFSet.mem_pair.2 (Or.inr rfl)) z (ZFSet.mem_pair.2 (Or.inr rfl)) rfl
298
+ · intro h p hp a _ z _ equal
299
+ exact h z (equal ▸ hp)
300
+
301
+ def graphFiberEqualityFormula {n} (x y f g : Fin n) : BoundedFormula n :=
302
+ .conj (graphFiberInclusionFormula x y f g) (graphFiberInclusionFormula y x g f)
303
+
304
+ theorem truth_graphFiberEqualityFormula {n} (x y f g : Fin n)
305
+ (env : Fin n → ZFSet.{u}) :
306
+ Truth (graphFiberEqualityFormula x y f g) env ↔
307
+ ∀ z, ZFSet.pair (env x) z ∈ env f ↔ ZFSet.pair (env y) z ∈ env g := by
308
+ simp only [graphFiberEqualityFormula, Truth, truth_graphFiberInclusionFormula]
309
+ exact ⟨fun h z => ⟨h.1 z, h.2 z⟩, fun h => ⟨fun z => (h z).1, fun z => (h z).2⟩⟩
310
+
311
+ end PartitionPilot.Forcing.BoundedFormula
312
+
313
+
314
+
315
+ namespace PartitionPilot.Forcing
316
+
317
+ universe u
318
+
319
+ structure PartialOrderCode (Q R : ZFSet.{u}) : Prop where
320
+ relation : R ⊆ ZFSet.prod Q Q
321
+ refl : ∀ x ∈ Q, ZFSet.pair x x ∈ R
322
+ antisymm : ∀ x ∈ Q, ∀ y ∈ Q, ZFSet.pair x y ∈ R → ZFSet.pair y x ∈ R → x = y
323
+ trans : ∀ x ∈ Q, ∀ y ∈ Q, ∀ z ∈ Q,
324
+ ZFSet.pair x y ∈ R → ZFSet.pair y z ∈ R → ZFSet.pair x z ∈ R
325
+
326
+ namespace BoundedFormula
327
+
328
+ open SetFormula
329
+
330
+ def relationOnFormula {n} (c r : Fin n) : BoundedFormula n :=
331
+ .allMem r (exMem c.succ (exMem c.succ.succ (orderedPairFormula 2 1 0)))
332
+
333
+ def reflexiveFormula {n} (c r : Fin n) : BoundedFormula n :=
334
+ .allMem c (pairMembershipFormula 0 0 r.succ)
335
+
336
+ def antisymmetricFormula {n} (c r : Fin n) : BoundedFormula n :=
337
+ .allMem c (.allMem c.succ (imp
338
+ (.conj (pairMembershipFormula 1 0 r.succ.succ) (pairMembershipFormula 0 1 r.succ.succ)) (.equal 1 0)))
339
+
340
+ def transitiveFormula {n} (c r : Fin n) : BoundedFormula n :=
341
+ .allMem c (.allMem c.succ (.allMem c.succ.succ (imp
342
+ (.conj (pairMembershipFormula 2 1 r.succ.succ.succ) (pairMembershipFormula 1 0 r.succ.succ.succ))
343
+ (pairMembershipFormula 2 0 r.succ.succ.succ))))
344
+
345
+ def partialOrderFormula {n} (c r : Fin n) : BoundedFormula n :=
346
+ .conj (relationOnFormula c r) (.conj (reflexiveFormula c r)
347
+ (.conj (antisymmetricFormula c r) (transitiveFormula c r)))
348
+
349
+ def topFormula {n} (c r t : Fin n) : BoundedFormula n :=
350
+ .conj (.mem t c) (.allMem c (pairMembershipFormula 0 t.succ r.succ))
351
+
352
+ theorem truth_relationOnFormula {n} (c r : Fin n) (env : Fin n → ZFSet.{u}) :
353
+ Truth (relationOnFormula c r) env ↔ env r ⊆ ZFSet.prod (env c) (env c) := by
354
+ simp only [relationOnFormula, Truth, truth_exMem, truth_orderedPairFormula]
355
+ exact forall_congr' (fun _ => forall_congr' (fun _ => ZFSet.mem_prod.symm))
356
+
357
+ theorem truth_partialOrderFormula {n} (c r : Fin n) (env : Fin n → ZFSet.{u}) :
358
+ Truth (partialOrderFormula c r) env ↔ PartialOrderCode (env c) (env r) := by
359
+ simp only [partialOrderFormula, Truth, truth_relationOnFormula, reflexiveFormula,
360
+ antisymmetricFormula, transitiveFormula, truth_imp, truth_pairMembershipFormula]
361
+ constructor
362
+ · rintro ⟨shape, refl, antisymm, trans⟩
363
+ exact ⟨shape, refl, fun x hx y hy xy yx => antisymm x hx y hy ⟨xy, yx⟩,
364
+ fun x hx y hy z hz xy yz => trans x hx y hy z hz ⟨xy, yz⟩⟩
365
+ · intro h
366
+ exact ⟨h.relation, h.refl, fun x hx y hy ⟨xy, yx⟩ => h.antisymm x hx y hy xy yx,
367
+ fun x hx y hy z hz ⟨xy, yz⟩ => h.trans x hx y hy z hz xy yz⟩
368
+
369
+ theorem truth_topFormula {n} (c r t : Fin n) (env : Fin n → ZFSet.{u}) :
370
+ Truth (topFormula c r t) env ↔ env t ∈ env c ∧ ∀ x ∈ env c, ZFSet.pair x (env t) ∈ env r := by
371
+ simp only [topFormula, Truth, truth_pairMembershipFormula]
372
+ rfl
373
+
374
+ end BoundedFormula
375
+
376
+ namespace TransitiveGround
377
+
378
+ open SetFormula
379
+ variable (M : TransitiveGround.{u})
380
+
381
+ theorem realize_partialOrderCode {Q R : ZFSet.{u}} (hQ : Q ∈ M.sets) (hR : R ∈ M.sets) :
382
+ Realize M.sets (BoundedFormula.partialOrderFormula 0 1).toFormula (extend Q (extend R Fin.elim0)) ↔
383
+ PartialOrderCode Q R :=
384
+ (BoundedFormula.realize_toFormula M _ _ (Fin.cases hQ (Fin.cases hR (fun i => Fin.elim0 i)))).trans
385
+ (BoundedFormula.truth_partialOrderFormula 0 1 _)
386
+
387
+ theorem partialOrderCode_absolute (N : TransitiveGround.{u}) {Q R : ZFSet.{u}}
388
+ (hQM : Q ∈ M.sets) (hRM : R ∈ M.sets) (hQN : Q ∈ N.sets) (hRN : R ∈ N.sets) :
389
+ Realize M.sets (BoundedFormula.partialOrderFormula 0 1).toFormula (extend Q (extend R Fin.elim0)) ↔
390
+ Realize N.sets (BoundedFormula.partialOrderFormula 0 1).toFormula (extend Q (extend R Fin.elim0)) :=
391
+ (M.realize_partialOrderCode hQM hRM).trans (N.realize_partialOrderCode hQN hRN).symm
392
+
393
+ end TransitiveGround
394
+
395
+ end PartitionPilot.Forcing
396
+
397
+
398
+
399
+ namespace PartitionPilot.Forcing.BoundedFormula
400
+
401
+ open SetFormula
402
+ universe u
403
+
404
+ def orderedTripleFormula {n} (w x y z : Fin n) : BoundedFormula n :=
405
+ exMem w (exMem 0 (.conj (orderedPairFormula 0 x.succ.succ y.succ.succ)
406
+ (orderedPairFormula w.succ.succ 0 z.succ.succ)))
407
+
408
+ def tripleMembershipFormula {n} (x y z f : Fin n) : BoundedFormula n :=
409
+ exMem f (orderedTripleFormula 0 x.succ y.succ z.succ)
410
+
411
+ theorem truth_orderedTripleFormula {n} (w x y z : Fin n) (env : Fin n → ZFSet.{u}) :
412
+ Truth (orderedTripleFormula w x y z) env ↔
413
+ env w = ZFSet.pair (ZFSet.pair (env x) (env y)) (env z) := by
414
+ simp only [orderedTripleFormula, truth_exMem, Truth, truth_orderedPairFormula]
415
+ change (∃ a ∈ env w, ∃ b ∈ a, b = ZFSet.pair (env x) (env y) ∧
416
+ env w = ZFSet.pair b (env z)) ↔ _
417
+ constructor
418
+ · rintro ⟨a, _, b, _, rfl, eq⟩
419
+ exact eq
420
+ · intro eq
421
+ refine ⟨{ZFSet.pair (env x) (env y)}, ?_, ZFSet.pair (env x) (env y),
422
+ ZFSet.mem_singleton.2 rfl, rfl, eq⟩
423
+ rw [eq]
424
+ exact ZFSet.mem_pair.2 (Or.inl rfl)
425
+
426
+ theorem truth_tripleMembershipFormula {n} (x y z f : Fin n) (env : Fin n → ZFSet.{u}) :
427
+ Truth (tripleMembershipFormula x y z f) env ↔
428
+ ZFSet.pair (ZFSet.pair (env x) (env y)) (env z) ∈ env f := by
429
+ simp only [tripleMembershipFormula, truth_exMem, truth_orderedTripleFormula]
430
+ change (∃ w ∈ env f, w = ZFSet.pair (ZFSet.pair (env x) (env y)) (env z)) ↔ _
431
+ exact ⟨fun ⟨_, hw, eq⟩ => eq ▸ hw, fun hw => ⟨_, hw, rfl⟩⟩
432
+
433
+ end PartitionPilot.Forcing.BoundedFormula
434
+
435
+
436
+ section
437
+
438
+ namespace PartitionPilot.Forcing.BoundedFormula
439
+
440
+ open SetFormula
441
+ universe u
442
+
443
+ theorem truth_relationBetweenFormula {n} (a b f : Fin n) (env : Fin n → ZFSet.{u}) :
444
+ Truth (relationBetweenFormula a b f) env ↔ env f ⊆ ZFSet.prod (env a) (env b) := by
445
+ simp only [relationBetweenFormula, Truth, truth_exMem, truth_orderedPairFormula]
446
+ exact forall_congr' (fun _ => forall_congr' (fun _ => ZFSet.mem_prod.symm))
447
+
448
+ theorem truth_functionFormula {n} (a b f : Fin n) (env : Fin n → ZFSet.{u}) :
449
+ Truth (functionFormula a b f) env ↔ ZFSet.IsFunc (env a) (env b) (env f) := by
450
+ simp only [functionFormula, Truth, truth_relationBetweenFormula, truth_exMem,
451
+ truth_pairMembershipFormula, truth_imp]
452
+ constructor
453
+ · rintro ⟨shape, total⟩
454
+ refine ⟨shape, ?_⟩
455
+ intro x hx
456
+ obtain ⟨y, _, pair, unique⟩ := total x hx
457
+ refine ⟨y, pair, ?_⟩
458
+ intro z rel
459
+ exact unique z (ZFSet.pair_mem_prod.1 (shape rel)).2 rel
460
+ · rintro ⟨shape, total⟩
461
+ refine ⟨shape, ?_⟩
462
+ intro x hx
463
+ obtain ⟨y, rel, unique⟩ := total x hx
464
+ exact ⟨y, (ZFSet.pair_mem_prod.1 (shape rel)).2, rel, fun z _ hz => unique z hz⟩
465
+
466
+ end PartitionPilot.Forcing.BoundedFormula
467
+
468
+ namespace PartitionPilot.Forcing.TransitiveGround
469
+
470
+ open SetFormula
471
+ universe u
472
+ variable (M : TransitiveGround.{u})
473
+
474
+ theorem realize_functionCode {A B f : ZFSet.{u}}
475
+ (hA : A ∈ M.sets) (hB : B ∈ M.sets) (hf : f ∈ M.sets) :
476
+ Realize M.sets (BoundedFormula.functionFormula 0 1 2).toFormula
477
+ (extend A (extend B (extend f Fin.elim0))) ↔ ZFSet.IsFunc A B f :=
478
+ (BoundedFormula.realize_toFormula M _ _ (Fin.cases hA (Fin.cases hB (Fin.cases hf (fun i => Fin.elim0 i))))).trans
479
+ (BoundedFormula.truth_functionFormula 0 1 2 _)
480
+
481
+ end PartitionPilot.Forcing.TransitiveGround
482
+
483
+ end
484
+
485
+
486
+ namespace PartitionPilot.Forcing.BoundedFormula
487
+
488
+ open SetFormula
489
+ universe u
490
+
491
+ def nestedActionTripleFormula {n} (z g a b c d : Fin n) : BoundedFormula n :=
492
+ let lift4 (j : Fin n) := j.succ.succ.succ.succ
493
+ let lift6 (j : Fin n) := j.succ.succ.succ.succ.succ.succ
494
+ exMem z (exMem 0 (exMem z.succ.succ (exMem 0
495
+ (.conj (orderedPairFormula (lift4 z) 2 0)
496
+ (.conj (orderedPairFormula 0 (lift4 c) (lift4 d))
497
+ (exMem 2 (exMem 0 (.conj (orderedPairFormula 4 (lift6 g) 0)
498
+ (orderedPairFormula 0 (lift6 a) (lift6 b))))))))))
499
+
500
+ theorem truth_nestedActionTripleFormula {n} (z g a b c d : Fin n)
501
+ (env : Fin n → ZFSet.{u}) :
502
+ Truth (nestedActionTripleFormula z g a b c d) env ↔
503
+ env z = ZFSet.pair (ZFSet.pair (env g) (ZFSet.pair (env a) (env b)))
504
+ (ZFSet.pair (env c) (env d)) := by
505
+ simp only [nestedActionTripleFormula, truth_exMem, Truth, truth_orderedPairFormula]
506
+ change (∃ s ∈ env z, ∃ x ∈ s, ∃ t ∈ env z, ∃ y ∈ t,
507
+ env z = ZFSet.pair x y ∧ y = ZFSet.pair (env c) (env d) ∧
508
+ ∃ w ∈ x, ∃ v ∈ w, x = ZFSet.pair (env g) v ∧ v = ZFSet.pair (env a) (env b)) ↔ _
509
+ constructor
510
+ · rintro ⟨_, _, x, _, _, _, y, _, outer, hy, _, _, v, _, hx, hv⟩
511
+ rw [outer, hy, hx, hv]
512
+ · intro equal
513
+ let v := ZFSet.pair (env a) (env b)
514
+ let x := ZFSet.pair (env g) v
515
+ let y := ZFSet.pair (env c) (env d)
516
+ refine ⟨{x}, ?_, x, ZFSet.mem_singleton.2 rfl, {x, y}, ?_, y,
517
+ ZFSet.mem_pair.2 (Or.inr rfl), equal, rfl, {env g, v},
518
+ ZFSet.mem_pair.2 (Or.inr rfl), v, ZFSet.mem_pair.2 (Or.inr rfl), rfl, rfl⟩
519
+ · rw [equal]
520
+ exact ZFSet.mem_pair.2 (Or.inl rfl)
521
+ · rw [equal]
522
+ exact ZFSet.mem_pair.2 (Or.inr rfl)
523
+
524
+
525
+
526
+
527
+
528
+
529
+ def binaryRelationFormula {n} (g f : Fin n) : BoundedFormula n :=
530
+ .allMem f (exMem g.succ (exMem g.succ.succ
531
+ (exMem g.succ.succ.succ (orderedTripleFormula 3 2 1 0))))
532
+
533
+ def binaryFunctionFormula {n} (g f : Fin n) : BoundedFormula n :=
534
+ .conj (binaryRelationFormula g f) (.allMem g (.allMem g.succ
535
+ (exMem g.succ.succ (.conj (tripleMembershipFormula 2 1 0 f.succ.succ.succ)
536
+ (.allMem g.succ.succ.succ (imp
537
+ (tripleMembershipFormula 3 2 0 f.succ.succ.succ.succ) (.equal 0 1)))))))
538
+
539
+ theorem truth_binaryRelationFormula {n} (g f : Fin n) (env : Fin n → ZFSet.{u}) :
540
+ Truth (binaryRelationFormula g f) env ↔
541
+ env f ⊆ ZFSet.prod (ZFSet.prod (env g) (env g)) (env g) := by
542
+ simp only [binaryRelationFormula, Truth, truth_exMem, truth_orderedTripleFormula]
543
+ constructor
544
+ · intro h w hw
545
+ obtain ⟨x, hx, y, hy, z, hz, eq⟩ := h w hw
546
+ exact ZFSet.mem_prod.2 ⟨ZFSet.pair x y, ZFSet.pair_mem_prod.2 ⟨hx, hy⟩, z, hz, eq⟩
547
+ · intro h w hw
548
+ obtain ⟨xy, hxy, z, hz, eq⟩ := ZFSet.mem_prod.1 (h hw)
549
+ obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy
550
+ exact ⟨x, hx, y, hy, z, hz, eq⟩
551
+
552
+ theorem truth_binaryFunctionFormula {n} (g f : Fin n) (env : Fin n → ZFSet.{u}) :
553
+ Truth (binaryFunctionFormula g f) env ↔
554
+ ZFSet.IsFunc (ZFSet.prod (env g) (env g)) (env g) (env f) := by
555
+ simp only [binaryFunctionFormula, Truth, truth_binaryRelationFormula, truth_exMem,
556
+ truth_tripleMembershipFormula, truth_imp]
557
+ constructor
558
+ · rintro ⟨shape, total⟩
559
+ refine ⟨shape, ?_⟩
560
+ intro xy hxy
561
+ obtain ⟨x, hx, y, hy, rfl⟩ := ZFSet.mem_prod.1 hxy
562
+ obtain ⟨z, _, rel, unique⟩ := total x hx y hy
563
+ refine ⟨z, rel, ?_⟩
564
+ intro w hw
565
+ exact unique w (ZFSet.pair_mem_prod.1 (shape hw)).2 hw
566
+ · rintro ⟨shape, total⟩
567
+ refine ⟨shape, ?_⟩
568
+ intro x hx y hy
569
+ obtain ⟨z, rel, unique⟩ := total (ZFSet.pair x y) (ZFSet.pair_mem_prod.2 ⟨hx, hy⟩)
570
+ exact ⟨z, (ZFSet.pair_mem_prod.1 (shape rel)).2, rel, fun w _ hw => unique w hw⟩
571
+
572
+ end PartitionPilot.Forcing.BoundedFormula
573
+
574
+
575
+
576
+ namespace PartitionPilot.Forcing
577
+
578
+ universe u
579
+
580
+ structure GroupCode (G m i e : ZFSet.{u}) : Prop where
581
+ mul_function : ZFSet.IsFunc (ZFSet.prod G G) G m
582
+ inv_function : ZFSet.IsFunc G G i
583
+ identity_mem : e ∈ G
584
+ one_mul : ∀ x ∈ G, ZFSet.pair (ZFSet.pair e x) x ∈ m
585
+ mul_one : ∀ x ∈ G, ZFSet.pair (ZFSet.pair x e) x ∈ m
586
+ inv_mul : ∀ x ∈ G, ∀ y ∈ G, ZFSet.pair x y ∈ i → ZFSet.pair (ZFSet.pair y x) e ∈ m
587
+ mul_assoc : ∀ x ∈ G, ∀ y ∈ G, ∀ z ∈ G, ∀ a ∈ G, ∀ b ∈ G, ∀ c ∈ G,
588
+ ZFSet.pair (ZFSet.pair x y) a ∈ m → ZFSet.pair (ZFSet.pair y z) b ∈ m →
589
+ ZFSet.pair (ZFSet.pair a z) c ∈ m → ZFSet.pair (ZFSet.pair x b) c ∈ m
590
+
591
+ namespace BoundedFormula
592
+
593
+ open SetFormula
594
+
595
+ def groupIdentityFormula {n} (g m e : Fin n) : BoundedFormula n :=
596
+ .allMem g (.conj (tripleMembershipFormula e.succ 0 0 m.succ)
597
+ (tripleMembershipFormula 0 e.succ 0 m.succ))
598
+
599
+ def groupInverseFormula {n} (g m i e : Fin n) : BoundedFormula n :=
600
+ .allMem g (.allMem g.succ (imp (pairMembershipFormula 1 0 i.succ.succ)
601
+ (tripleMembershipFormula 0 1 e.succ.succ m.succ.succ)))
602
+
603
+ def groupAssociativeFormula {n} (g m : Fin n) : BoundedFormula n :=
604
+ .allMem g (.allMem g.succ (.allMem g.succ.succ (.allMem g.succ.succ.succ
605
+ (.allMem g.succ.succ.succ.succ (.allMem g.succ.succ.succ.succ.succ
606
+ (imp (.conj (tripleMembershipFormula 5 4 2 m.succ.succ.succ.succ.succ.succ)
607
+ (.conj (tripleMembershipFormula 4 3 1 m.succ.succ.succ.succ.succ.succ)
608
+ (tripleMembershipFormula 2 3 0 m.succ.succ.succ.succ.succ.succ)))
609
+ (tripleMembershipFormula 5 1 0 m.succ.succ.succ.succ.succ.succ)))))))
610
+
611
+ def groupFormula {n} (g m i e : Fin n) : BoundedFormula n :=
612
+ .conj (binaryFunctionFormula g m) (.conj (functionFormula g g i)
613
+ (.conj (.mem e g) (.conj (groupIdentityFormula g m e)
614
+ (.conj (groupInverseFormula g m i e) (groupAssociativeFormula g m)))))
615
+
616
+ theorem truth_groupFormula {n} (g m i e : Fin n) (env : Fin n → ZFSet.{u}) :
617
+ Truth (groupFormula g m i e) env ↔ GroupCode (env g) (env m) (env i) (env e) := by
618
+ simp only [groupFormula, Truth, truth_binaryFunctionFormula, truth_functionFormula,
619
+ groupIdentityFormula, groupInverseFormula, groupAssociativeFormula,
620
+ truth_tripleMembershipFormula, truth_pairMembershipFormula, truth_imp]
621
+ constructor
622
+ · rintro ⟨mul, inv, one, identity, inverse, assoc⟩
623
+ exact ⟨mul, inv, one, fun x hx => (identity x hx).1,
624
+ fun x hx => (identity x hx).2, inverse,
625
+ fun x hx y hy z hz a ha b hb c hc xy yz az => assoc x hx y hy z hz a ha b hb c hc ⟨xy, yz, az⟩⟩
626
+ · intro h
627
+ exact ⟨h.mul_function, h.inv_function, h.identity_mem,
628
+ fun x hx => ⟨h.one_mul x hx, h.mul_one x hx⟩, h.inv_mul,
629
+ fun x hx y hy z hz a ha b hb c hc ⟨xy, yz, az⟩ => h.mul_assoc x hx y hy z hz a ha b hb c hc xy yz az⟩
630
+
631
+ end BoundedFormula
632
+
633
+ namespace TransitiveGround
634
+
635
+ open SetFormula
636
+ variable (M : TransitiveGround.{u})
637
+
638
+ theorem realize_groupCode {G m i e : ZFSet.{u}}
639
+ (hG : G ∈ M.sets) (hm : m ∈ M.sets) (hi : i ∈ M.sets) (he : e ∈ M.sets) :
640
+ Realize M.sets (BoundedFormula.groupFormula 0 1 2 3).toFormula
641
+ (extend G (extend m (extend i (extend e Fin.elim0)))) ↔ GroupCode G m i e :=
642
+ (BoundedFormula.realize_toFormula M _ _
643
+ (Fin.cases hG (Fin.cases hm (Fin.cases hi (Fin.cases he (fun j => Fin.elim0 j)))))).trans
644
+ (BoundedFormula.truth_groupFormula 0 1 2 3 _)
645
+
646
+ end TransitiveGround
647
+
648
+ end PartitionPilot.Forcing
649
+
650
+
651
+
652
+ namespace PartitionPilot.SetRealization.Presentation
653
+ open Forcing
654
+ universe u
655
+ variable {G : Type u} [Group G] (s : Presentation G)
656
+
657
+ theorem groupCode : GroupCode s.carrier
658
+ ((s.product s).graph s (fun xy => xy.1 * xy.2))
659
+ (s.graph s (fun x => x⁻¹)) (s.encode 1) := by
660
+ refine ⟨(s.product s).graph_isFunc s _, s.graph_isFunc s _, s.encode_mem 1, ?_, ?_, ?_, ?_⟩
661
+ · intro x hx
662
+ obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx
663
+ exact ((s.product s).pair_mem_graph s _ (1, a) a).2 (one_mul a)
664
+ · intro x hx
665
+ obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx
666
+ exact ((s.product s).pair_mem_graph s _ (a, 1) a).2 (mul_one a)
667
+ · intro x hx y hy entry
668
+ obtain ⟨a, rfl⟩ := (s.mem_carrier x).1 hx
669
+ obtain ⟨b, rfl⟩ := (s.mem_carrier y).1 hy
670
+ have inverse := (s.pair_mem_graph s _ a b).1 entry
671
+ apply ((s.product s).pair_mem_graph s _ (b, a) 1).2
672
+ rw [← inverse, inv_mul_cancel]
673
+ · intro x hx y hy z hz a ha b hb c hc xy yz az
674
+ obtain ⟨x, rfl⟩ := (s.mem_carrier x).1 hx
675
+ obtain ⟨y, rfl⟩ := (s.mem_carrier y).1 hy
676
+ obtain ⟨z, rfl⟩ := (s.mem_carrier z).1 hz
677
+ obtain ⟨a, rfl⟩ := (s.mem_carrier a).1 ha
678
+ obtain ⟨b, rfl⟩ := (s.mem_carrier b).1 hb
679
+ obtain ⟨c, rfl⟩ := (s.mem_carrier c).1 hc
680
+ have first := ((s.product s).pair_mem_graph s _ (x, y) a).1 xy
681
+ have second := ((s.product s).pair_mem_graph s _ (y, z) b).1 yz
682
+ have third := ((s.product s).pair_mem_graph s _ (a, z) c).1 az
683
+ apply ((s.product s).pair_mem_graph s _ (x, b) c).2
684
+ rw [← second, ← mul_assoc, first, third]
685
+
686
+ end PartitionPilot.SetRealization.Presentation
687
+
688
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/PresentedRowAssignmentGraphs.lean CHANGED
@@ -1,70 +1,70 @@
1
- import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawRefinementStageWitnesses
2
-
3
- namespace OAI
4
-
5
- open scoped ZFSet
6
-
7
- section
8
-
9
- namespace PartitionPilot.Forcing
10
- open SetRealization
11
- universe u
12
- variable {G R : Type u} [Group G] [PartialOrder R]
13
- variable (a : PosetAction G R) (c : Presentation R) (t : Presentation G)
14
- variable (Q J B : ZFSet.{u})
15
-
16
- theorem presentedRowAssignmentGraph_entry (g : G) (r q : R) (A D : ZFSet.{u}) :
17
- ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (c.encode r) A)) (ZFSet.pair (c.encode q) D) ∈
18
- rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B ↔
19
- ZFSet.pair (c.encode r) A ∈ Q ∧ ZFSet.pair (c.encode q) D ∈ Q ∧
20
- a.iso g r = q ∧ D = relationImage A J (rawActionSection (t.encode g) B J) := by
21
- rw [pair_mem_rawRowAssignmentActionGraph]
22
- constructor
23
- · rintro ⟨_, first, second, _, _, _, _, row, image⟩
24
- exact ⟨first, second, (a.triple_mem_actionGraph c t g r q).1 row, image⟩
25
- · rintro ⟨first, second, row, image⟩
26
- exact ⟨t.encode_mem g, first, second, c.encode_mem r, pair_second_mem_doubleUnion first,
27
- c.encode_mem q, pair_second_mem_doubleUnion second,
28
- (a.triple_mem_actionGraph c t g r q).2 row, image⟩
29
-
30
- theorem presentedRowAssignmentGraph_bound :
31
- rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B ⊆
32
- ZFSet.prod (ZFSet.prod t.carrier Q) Q := by
33
- intro z hz
34
- unfold rawRowAssignmentActionGraph rowAssignmentActionGraph at hz
35
- exact (ZFSet.mem_sep.1 hz).1
36
-
37
- omit [PartialOrder R] in
38
- theorem exists_presentedRowAssignmentCoordinates
39
- {Q V z : ZFSet.{u}} (shape : Q ⊆ ZFSet.prod c.carrier V) (member : z ∈ Q) :
40
- ∃ r : R, ∃ A ∈ V, z = ZFSet.pair (c.encode r) A := by
41
- obtain ⟨r, hr, A, hA, rfl⟩ := ZFSet.mem_prod.1 (shape member)
42
- obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr
43
- exact ⟨r, A, hA, rfl⟩
44
-
45
- theorem presentedRowAssignmentGraph_function {V : ZFSet.{u}}
46
- (shape : Q ⊆ ZFSet.prod c.carrier V)
47
- (preserves : ∀ g : G, ∀ r : R, ∀ A,
48
- ZFSet.pair (c.encode r) A ∈ Q →
49
- ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J)) ∈ Q) :
50
- ZFSet.IsFunc (ZFSet.prod t.carrier Q) Q
51
- (rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B) := by
52
- refine ⟨presentedRowAssignmentGraph_bound a c t Q J B, ?_⟩
53
- intro z hz
54
- obtain ⟨g, hg, p, hp, rfl⟩ := ZFSet.mem_prod.1 hz
55
- obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg
56
- obtain ⟨r, A, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hp
57
- refine ⟨ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J)),
58
- (presentedRowAssignmentGraph_entry a c t Q J B g r _ A _).2
59
- ⟨hp, preserves g r A hp, rfl, rfl⟩, ?_⟩
60
- intro y edge
61
- have hy := (ZFSet.pair_mem_prod.1 (presentedRowAssignmentGraph_bound a c t Q J B edge)).2
62
- obtain ⟨q, D, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hy
63
- obtain ⟨_, _, row, rfl⟩ := (presentedRowAssignmentGraph_entry a c t Q J B g r q A D).1 edge
64
- rw [row]
65
-
66
- end PartitionPilot.Forcing
67
-
68
- end
69
-
70
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRawRefinementStageWitnesses
2
+
3
+ namespace OAI
4
+
5
+ open scoped ZFSet
6
+
7
+ section
8
+
9
+ namespace PartitionPilot.Forcing
10
+ open SetRealization
11
+ universe u
12
+ variable {G R : Type u} [Group G] [PartialOrder R]
13
+ variable (a : PosetAction G R) (c : Presentation R) (t : Presentation G)
14
+ variable (Q J B : ZFSet.{u})
15
+
16
+ theorem presentedRowAssignmentGraph_entry (g : G) (r q : R) (A D : ZFSet.{u}) :
17
+ ZFSet.pair (ZFSet.pair (t.encode g) (ZFSet.pair (c.encode r) A)) (ZFSet.pair (c.encode q) D) ∈
18
+ rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B ↔
19
+ ZFSet.pair (c.encode r) A ∈ Q ∧ ZFSet.pair (c.encode q) D ∈ Q ∧
20
+ a.iso g r = q ∧ D = relationImage A J (rawActionSection (t.encode g) B J) := by
21
+ rw [pair_mem_rawRowAssignmentActionGraph]
22
+ constructor
23
+ · rintro ⟨_, first, second, _, _, _, _, row, image⟩
24
+ exact ⟨first, second, (a.triple_mem_actionGraph c t g r q).1 row, image⟩
25
+ · rintro ⟨first, second, row, image⟩
26
+ exact ⟨t.encode_mem g, first, second, c.encode_mem r, pair_second_mem_doubleUnion first,
27
+ c.encode_mem q, pair_second_mem_doubleUnion second,
28
+ (a.triple_mem_actionGraph c t g r q).2 row, image⟩
29
+
30
+ theorem presentedRowAssignmentGraph_bound :
31
+ rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B ⊆
32
+ ZFSet.prod (ZFSet.prod t.carrier Q) Q := by
33
+ intro z hz
34
+ unfold rawRowAssignmentActionGraph rowAssignmentActionGraph at hz
35
+ exact (ZFSet.mem_sep.1 hz).1
36
+
37
+ omit [PartialOrder R] in
38
+ theorem exists_presentedRowAssignmentCoordinates
39
+ {Q V z : ZFSet.{u}} (shape : Q ⊆ ZFSet.prod c.carrier V) (member : z ∈ Q) :
40
+ ∃ r : R, ∃ A ∈ V, z = ZFSet.pair (c.encode r) A := by
41
+ obtain ⟨r, hr, A, hA, rfl⟩ := ZFSet.mem_prod.1 (shape member)
42
+ obtain ⟨r, rfl⟩ := (c.mem_carrier r).1 hr
43
+ exact ⟨r, A, hA, rfl⟩
44
+
45
+ theorem presentedRowAssignmentGraph_function {V : ZFSet.{u}}
46
+ (shape : Q ⊆ ZFSet.prod c.carrier V)
47
+ (preserves : ∀ g : G, ∀ r : R, ∀ A,
48
+ ZFSet.pair (c.encode r) A ∈ Q →
49
+ ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J)) ∈ Q) :
50
+ ZFSet.IsFunc (ZFSet.prod t.carrier Q) Q
51
+ (rawRowAssignmentActionGraph t.carrier Q c.carrier (⋃₀ ⋃₀ Q) J (a.actionGraph c t) B) := by
52
+ refine ⟨presentedRowAssignmentGraph_bound a c t Q J B, ?_⟩
53
+ intro z hz
54
+ obtain ⟨g, hg, p, hp, rfl⟩ := ZFSet.mem_prod.1 hz
55
+ obtain ⟨g, rfl⟩ := (t.mem_carrier g).1 hg
56
+ obtain ⟨r, A, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hp
57
+ refine ⟨ZFSet.pair (c.encode (a.iso g r)) (relationImage A J (rawActionSection (t.encode g) B J)),
58
+ (presentedRowAssignmentGraph_entry a c t Q J B g r _ A _).2
59
+ ⟨hp, preserves g r A hp, rfl, rfl⟩, ?_⟩
60
+ intro y edge
61
+ have hy := (ZFSet.pair_mem_prod.1 (presentedRowAssignmentGraph_bound a c t Q J B edge)).2
62
+ obtain ⟨q, D, _, rfl⟩ := exists_presentedRowAssignmentCoordinates c shape hy
63
+ obtain ⟨_, _, row, rfl⟩ := (presentedRowAssignmentGraph_entry a c t Q J B g r q A D).1 edge
64
+ rw [row]
65
+
66
+ end PartitionPilot.Forcing
67
+
68
+ end
69
+
70
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/PreservedMainPrefixHistoryFormulas.lean CHANGED
@@ -1,428 +1,428 @@
1
- import OAI.SetTheory.PartitionPrinciple.Forcing.MainPrefixConditionalStepCodes
2
- import OAI.SetTheory.PartitionPrinciple.Transfinite.PreservedMainPrefixHistoryValues
3
-
4
- namespace OAI
5
-
6
- namespace PartitionPilot.Forcing
7
-
8
- namespace BoundedFormula
9
- open SetFormula
10
- universe u
11
-
12
- def nonzeroLimitOrdinalFormula {n} (T : Fin n) : BoundedFormula n :=
13
- .conj (.neg (emptyFormula T)) (.allMem T (exMem T.succ (.mem 1 0)))
14
-
15
- theorem truth_nonzeroLimitOrdinalFormula {n} (T : Fin n)
16
- (env : Fin n → ZFSet.{u}) :
17
- Truth (nonzeroLimitOrdinalFormula T) env ↔ NonzeroLimitOrdinalCode (env T) := by
18
- simp only [nonzeroLimitOrdinalFormula, Truth, truth_emptyFormula, truth_exMem]
19
- rfl
20
-
21
- theorem realize_nonzeroLimitOrdinalFormula (M : TransitiveGround.{u}) {n}
22
- (T : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) :
23
- Realize M.sets (nonzeroLimitOrdinalFormula T).toFormula env ↔
24
- NonzeroLimitOrdinalCode (env T) :=
25
- (realize_toFormula M _ env members).trans (truth_nonzeroLimitOrdinalFormula T env)
26
-
27
- end BoundedFormula
28
-
29
- open SetFormula
30
- universe u
31
-
32
- namespace BoundedFormula
33
- def mainPrefixFieldExtensionFormula {n} (T S E T' S' E' : Fin n) : BoundedFormula n :=
34
- .conj (subsetFormula T T') (.conj (subsetFormula S S') (subsetFormula E E'))
35
-
36
- theorem truth_mainPrefixFieldExtensionFormula {n} (T S E T' S' E' : Fin n)
37
- (env : Fin n → ZFSet.{u}) :
38
- Truth (mainPrefixFieldExtensionFormula T S E T' S' E') env ↔
39
- env T ⊆ env T' ∧ env S ⊆ env S' ∧ env E ⊆ env E' := by
40
- simp only [mainPrefixFieldExtensionFormula, Truth, truth_subsetFormula]
41
-
42
- end BoundedFormula
43
-
44
- namespace SetFormula
45
- def mainPrefixExtensionFormula {n} (old next : Fin n) : SetFormula n :=
46
- let outer := suffixIndex n 6
47
- let field := prefixIndex n 6
48
- exBlock 6 (.conj
49
- (BoundedFormula.mainPrefixTupleFormula (outer old) (field 0) (field 1) (field 2)).toFormula
50
- (.conj (BoundedFormula.mainPrefixTupleFormula (outer next) (field 3) (field 4) (field 5)).toFormula
51
- (BoundedFormula.mainPrefixFieldExtensionFormula
52
- (field 0) (field 1) (field 2) (field 3) (field 4) (field 5)).toFormula))
53
-
54
- end SetFormula
55
-
56
- namespace TransitiveGround
57
- variable (M : TransitiveGround.{u})
58
-
59
- theorem realize_mainPrefixExtensionFormula {n} (old next : Fin n)
60
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
61
- Realize M.sets (mainPrefixExtensionFormula old next) env ↔
62
- MainPrefixExtends (env old) (env next) := by
63
- rw [mainPrefixExtensionFormula, realize_exBlock]
64
- let outer := suffixIndex n 6
65
- let field := prefixIndex n 6
66
- have actual (f : Fin 6 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) :
67
- (Realize M.sets (BoundedFormula.mainPrefixTupleFormula (outer old) (field 0) (field 1) (field 2)).toFormula
68
- (extendMany 6 f env) ∧
69
- Realize M.sets (BoundedFormula.mainPrefixTupleFormula (outer next) (field 3) (field 4) (field 5)).toFormula
70
- (extendMany 6 f env) ∧
71
- Realize M.sets (BoundedFormula.mainPrefixFieldExtensionFormula
72
- (field 0) (field 1) (field 2) (field 3) (field 4) (field 5)).toFormula (extendMany 6 f env)) ↔
73
- env old = mainPrefixCode (f 0) (f 1) (f 2) ∧
74
- env next = mainPrefixCode (f 3) (f 4) (f 5) ∧ f 0 ⊆ f 3 ∧ f 1 ⊆ f 4 ∧ f 2 ⊆ f 5 := by
75
- have mems := extendMany_members 6 f env ground members
76
- rw [BoundedFormula.realize_mainPrefixTupleFormula M _ _ _ _ _ mems,
77
- BoundedFormula.realize_mainPrefixTupleFormula M _ _ _ _ _ mems,
78
- BoundedFormula.realize_toFormula M _ _ mems, BoundedFormula.truth_mainPrefixFieldExtensionFormula]
79
- simp only [outer, field, extendMany_prefix, extendMany_suffix]
80
- constructor
81
- · rintro ⟨f, ground, clauses⟩
82
- have result := (actual f ground).1 clauses
83
- exact ⟨f 0, f 1, f 2, f 3, f 4, f 5, result⟩
84
- · rintro ⟨T, S, E, U, F, G, first, second, indices, stages, transitions⟩
85
- have left := M.mainPrefixCode_fields_mem (first ▸ members old)
86
- have right := M.mainPrefixCode_fields_mem (second ▸ members next)
87
- let f : Fin 6 → ZFSet.{u} := Fin.cases T (Fin.cases S (Fin.cases E
88
- (Fin.cases U (Fin.cases F (fun _ => G)))))
89
- have ground : ∀ j, f j ∈ M.sets := Fin.cases left.1 (Fin.cases left.2.1
90
- (Fin.cases left.2.2 (Fin.cases right.1 (Fin.cases right.2.1 (fun _ => right.2.2)))))
91
- exact ⟨f, ground, (actual f ground).2 ⟨first, second, indices, stages, transitions⟩⟩
92
-
93
- end TransitiveGround
94
-
95
- namespace SetFormula
96
-
97
- def mainPrefixLimitStepRawFormula {n} (K Labels C D rD N old next : Fin n)
98
- (w : Fin 32 → Fin n) : SetFormula n :=
99
- let v := mainPrefixLimitTargetFields w
100
- .conj (BoundedFormula.successorFormula (w 7) (w 0)).toFormula
101
- (.conj (BoundedFormula.mainPrefixTupleFormula old (w 0) (w 1) (w 2)).toFormula
102
- (.conj (BoundedFormula.mainPrefixTupleFormula next (w 7) (w 3) (w 4)).toFormula
103
- (.conj (mainPrefixExtensionFormula old next)
104
- (.conj (BoundedFormula.pairMembershipFormula (w 0) (w 5) (w 3)).toFormula
105
- (.conj (linkedMainStageRawFormula K Labels C D rD N (w 5) v)
106
- (.conj (BoundedFormula.pairMembershipFormula (v 11) (w 6) (v 17)).toFormula
107
- (BoundedFormula.mainLimitCoverageFormula (w 0) (w 1) (w 4)
108
- (v 0) (v 3) (v 1) (v 9) (v 11) (w 6)).toFormula))))))
109
-
110
- def mainPrefixLimitStepFormula {n} (K Labels C D rD N old next : Fin n) : SetFormula n :=
111
- let outer := suffixIndex n 32
112
- exBlock 32 (mainPrefixLimitStepRawFormula (outer K) (outer Labels) (outer C)
113
- (outer D) (outer rD) (outer N) (outer old) (outer next) (prefixIndex n 32))
114
-
115
- end SetFormula
116
-
117
- namespace TransitiveGround
118
- variable (M : TransitiveGround.{u})
119
-
120
- theorem realize_mainPrefixLimitStepRawFormula
121
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
122
- (unions : Realize M.sets SetFormula.union Fin.elim0)
123
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
124
- (collection : CollectionSchema M.sets) {n} (K Labels C D rD N old next : Fin n)
125
- (w : Fin 32 → Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
126
- (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) :
127
- Realize M.sets (mainPrefixLimitStepRawFormula K Labels C D rD N old next w) env ↔
128
- MainPrefixLimitStepRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N)
129
- (env old) (env next) (fun j => env (w j)) := by
130
- have linked := M.realize_linkedMainStageRawFormula pairing unions powers separation collection
131
- K Labels C D rD N (w 5) (mainPrefixLimitTargetFields w) env members omega ordinal
132
- have extension := M.realize_mainPrefixExtensionFormula old next env members
133
- simp only [mainPrefixLimitStepRawFormula, Realize, BoundedFormula.realize_toFormula M _ env members,
134
- BoundedFormula.truth_successorFormula, BoundedFormula.truth_mainPrefixTupleFormula,
135
- extension, BoundedFormula.truth_pairMembershipFormula, linked,
136
- BoundedFormula.truth_mainLimitCoverageFormula]
137
- rfl
138
-
139
- theorem realize_mainPrefixLimitStepFormula
140
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
141
- (unions : Realize M.sets SetFormula.union Fin.elim0)
142
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
143
- (collection : CollectionSchema M.sets) {n} (K Labels C D rD N old next : Fin n)
144
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
145
- (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) :
146
- Realize M.sets (mainPrefixLimitStepFormula K Labels C D rD N old next) env ↔
147
- MainPrefixLimitStepCode M (env K) (env Labels) (env C) (env D) (env rD) (env N)
148
- (env old) (env next) := by
149
- rw [mainPrefixLimitStepFormula, realize_exBlock]
150
- have actual (w : Fin 32 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) :=
151
- M.realize_mainPrefixLimitStepRawFormula pairing unions powers separation collection
152
- (suffixIndex n 32 K) (suffixIndex n 32 Labels) (suffixIndex n 32 C) (suffixIndex n 32 D)
153
- (suffixIndex n 32 rD) (suffixIndex n 32 N) (suffixIndex n 32 old) (suffixIndex n 32 next)
154
- (prefixIndex n 32) (extendMany 32 w env) (extendMany_members 32 w env ground members)
155
- (by simpa only [extendMany_suffix] using omega)
156
- (by simpa only [extendMany_suffix] using ordinal)
157
- simp only [extendMany_prefix, extendMany_suffix] at actual
158
- exact ⟨fun ⟨w, ground, recognized⟩ => ⟨w, ground, (actual w ground).1 recognized⟩,
159
- fun ⟨w, ground, raw⟩ => ⟨w, ground, (actual w ground).2 raw⟩⟩
160
-
161
- end TransitiveGround
162
-
163
- namespace BoundedFormula
164
- def mainPrefixSelectedStepBody {n} (f old next : Fin n) (v : Fin 10 → Fin n) : BoundedFormula n :=
165
- .conj (successorFormula (v 8) (v 0))
166
- (.conj (successorFormula (v 9) (v 8))
167
- (.conj (mainPrefixTupleFormula old (v 8) (v 1) (v 2))
168
- (.conj (mainPrefixTupleFormula next (v 9) (v 3) (v 4))
169
- (.conj (mainPrefixFieldExtensionFormula (v 8) (v 1) (v 2) (v 9) (v 3) (v 4))
170
- (.conj (pairMembershipFormula (v 0) (v 5) (v 1))
171
- (.conj (rightTripleMembershipFormula (v 5) (v 6) (v 7) f)
172
- (.conj (pairMembershipFormula (v 8) (v 6) (v 3))
173
- (tripleMembershipFormula (v 8) (v 0) (v 7) (v 4)))))))))
174
-
175
- theorem truth_mainPrefixSelectedStepBody {n} (f old next : Fin n) (v : Fin 10 → Fin n)
176
- (env : Fin n → ZFSet.{u}) :
177
- Truth (mainPrefixSelectedStepBody f old next v) env ↔
178
- env (v 8) = insert (env (v 0)) (env (v 0)) ∧
179
- env (v 9) = insert (env (v 8)) (env (v 8)) ∧
180
- env old = mainPrefixCode (env (v 8)) (env (v 1)) (env (v 2)) ∧
181
- env next = mainPrefixCode (env (v 9)) (env (v 3)) (env (v 4)) ∧
182
- (env (v 8) ⊆ env (v 9) ∧ env (v 1) ⊆ env (v 3) ∧ env (v 2) ⊆ env (v 4)) ∧
183
- ZFSet.pair (env (v 0)) (env (v 5)) ∈ env (v 1) ∧
184
- ZFSet.pair (env (v 5)) (ZFSet.pair (env (v 6)) (env (v 7))) ∈ env f ∧
185
- ZFSet.pair (env (v 8)) (env (v 6)) ∈ env (v 3) ∧
186
- ZFSet.pair (ZFSet.pair (env (v 8)) (env (v 0))) (env (v 7)) ∈ env (v 4) := by
187
- simp only [mainPrefixSelectedStepBody, Truth, truth_successorFormula,
188
- truth_mainPrefixTupleFormula, truth_mainPrefixFieldExtensionFormula,
189
- truth_pairMembershipFormula, truth_rightTripleMembershipFormula, truth_tripleMembershipFormula]
190
-
191
- end BoundedFormula
192
-
193
- namespace SetFormula
194
- def mainPrefixSelectedStepFormula {n} (f old next : Fin n) : SetFormula n :=
195
- exBlock 10 (BoundedFormula.mainPrefixSelectedStepBody
196
- (suffixIndex n 10 f) (suffixIndex n 10 old) (suffixIndex n 10 next)
197
- (prefixIndex n 10)).toFormula
198
-
199
- end SetFormula
200
-
201
- namespace TransitiveGround
202
- variable (M : TransitiveGround.{u})
203
-
204
- theorem realize_mainPrefixSelectedStepFormula {n} (f old next : Fin n)
205
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
206
- Realize M.sets (mainPrefixSelectedStepFormula f old next) env ↔
207
- MainPrefixSelectedStepCode (env f) (env old) (env next) := by
208
- rw [mainPrefixSelectedStepFormula, realize_exBlock]
209
- have actual (v : Fin 10 → ZFSet.{u}) (ground : ∀ j, v j ∈ M.sets) :=
210
- (BoundedFormula.realize_toFormula M _ (extendMany 10 v env)
211
- (extendMany_members 10 v env ground members)).trans
212
- (BoundedFormula.truth_mainPrefixSelectedStepBody
213
- (suffixIndex n 10 f) (suffixIndex n 10 old) (suffixIndex n 10 next)
214
- (prefixIndex n 10) (extendMany 10 v env))
215
- simp only [extendMany_prefix, extendMany_suffix] at actual
216
- constructor
217
- · rintro ⟨v, ground, recognized⟩
218
- obtain ⟨first, second, oldCode, nextCode, extension, source, selected, target, crossing⟩ :=
219
- (actual v ground).1 recognized
220
- refine ⟨v 0, v 1, v 2, v 3, v 4, v 5, v 6, v 7, ?_, ?_, ?_, source, selected, ?_, ?_⟩
221
- · simpa only [first] using oldCode
222
- · simpa only [second, first] using nextCode
223
- · rw [oldCode, nextCode]
224
- exact mainPrefixExtends_iff.2 extension
225
- · simpa only [first] using target
226
- · simpa only [first] using crossing
227
- · rintro ⟨b, S, E, S', E', a, target, z, oldCode, nextCode,
228
- extension, source, selected, targetEntry, crossing⟩
229
- have left := M.mainPrefixCode_fields_mem (oldCode ▸ members old)
230
- have right := M.mainPrefixCode_fields_mem (nextCode ▸ members next)
231
- have sourceGround := M.transitive left.2.1 source
232
- have selectedGround := M.transitive (members f) selected
233
- let v : Fin 10 → ZFSet.{u} := Fin.cases b (Fin.cases S (Fin.cases E
234
- (Fin.cases S' (Fin.cases E' (Fin.cases a (Fin.cases target (Fin.cases z
235
- (Fin.cases (insert b b) (fun _ => insert (insert b b) (insert b b))))))))))
236
- have ground : ∀ j, v j ∈ M.sets := Fin.cases (M.pair_left sourceGround)
237
- (Fin.cases left.2.1 (Fin.cases left.2.2 (Fin.cases right.2.1 (Fin.cases right.2.2
238
- (Fin.cases (M.pair_right sourceGround) (Fin.cases (M.pair_left (M.pair_right selectedGround))
239
- (Fin.cases (M.pair_right (M.pair_right selectedGround)) (Fin.cases left.1 (fun _ => right.1)))))))))
240
- rw [oldCode, nextCode] at extension
241
- exact ⟨v, ground, (actual v ground).2 ⟨rfl, rfl, oldCode, nextCode,
242
- mainPrefixExtends_iff.1 extension, source, selected, targetEntry, crossing⟩⟩
243
-
244
- end TransitiveGround
245
-
246
- namespace SetFormula
247
- def mainPrefixConditionalStepFormula {n} (K Labels C D rD N f old next : Fin n) : SetFormula n :=
248
- let outer := suffixIndex n 3
249
- let field := prefixIndex n 3
250
- disj (mainPrefixSelectedStepFormula f old next)
251
- (exBlock 3 (.conj
252
- (BoundedFormula.mainPrefixTupleFormula (outer old) (field 0) (field 1) (field 2)).toFormula
253
- (.conj (BoundedFormula.nonzeroLimitOrdinalFormula (field 0)).toFormula
254
- (mainPrefixLimitStepFormula (outer K) (outer Labels) (outer C) (outer D)
255
- (outer rD) (outer N) (outer old) (outer next)))))
256
-
257
- end SetFormula
258
-
259
- namespace TransitiveGround
260
- variable (M : TransitiveGround.{u})
261
-
262
- theorem realize_mainPrefixConditionalStepFormula
263
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
264
- (unions : Realize M.sets SetFormula.union Fin.elim0)
265
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
266
- (collection : CollectionSchema M.sets) {n}
267
- (K Labels C D rD N f old next : Fin n) (env : Fin n → ZFSet.{u})
268
- (members : ∀ j, env j ∈ M.sets) (omega : env N = ZFSet.omega)
269
- (ordinal : ordinalSetProperty (env K)) :
270
- Realize M.sets (mainPrefixConditionalStepFormula K Labels C D rD N f old next) env ↔
271
- MainPrefixConditionalStepCode M (env K) (env Labels) (env C) (env D) (env rD)
272
- (env N) (env f) (env old) (env next) := by
273
- rw [mainPrefixConditionalStepFormula, realize_disj,
274
- M.realize_mainPrefixSelectedStepFormula f old next env members, realize_exBlock]
275
- apply or_congr Iff.rfl
276
- let outer := suffixIndex n 3
277
- let field := prefixIndex n 3
278
- have actual (w : Fin 3 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) :
279
- Realize M.sets (.conj
280
- (BoundedFormula.mainPrefixTupleFormula (outer old) (field 0) (field 1) (field 2)).toFormula
281
- (.conj (BoundedFormula.nonzeroLimitOrdinalFormula (field 0)).toFormula
282
- (mainPrefixLimitStepFormula (outer K) (outer Labels) (outer C) (outer D)
283
- (outer rD) (outer N) (outer old) (outer next)))) (extendMany 3 w env) ↔
284
- env old = mainPrefixCode (w 0) (w 1) (w 2) ∧ NonzeroLimitOrdinalCode (w 0) ∧
285
- MainPrefixLimitStepCode M (env K) (env Labels) (env C) (env D) (env rD) (env N)
286
- (env old) (env next) := by
287
- have mems := extendMany_members 3 w env ground members
288
- change (Realize M.sets _ _ ∧ Realize M.sets _ _ ∧ Realize M.sets _ _) ↔ _
289
- rw [BoundedFormula.realize_mainPrefixTupleFormula M _ _ _ _ _ mems,
290
- BoundedFormula.realize_nonzeroLimitOrdinalFormula M _ _ mems,
291
- M.realize_mainPrefixLimitStepFormula pairing unions powers separation collection
292
- _ _ _ _ _ _ _ _ _ mems (by simpa only [outer, extendMany_suffix] using omega)
293
- (by simpa only [outer, extendMany_suffix] using ordinal)]
294
- simp only [outer, field, extendMany_suffix, extendMany_prefix]
295
- constructor
296
- · rintro ⟨w, ground, recognized⟩
297
- exact ⟨w 0, w 1, w 2, (actual w ground).1 recognized⟩
298
- · rintro ⟨T, S, E, oldCode, nonzero, code⟩
299
- have fields := M.mainPrefixCode_fields_mem (oldCode ▸ members old)
300
- let w : Fin 3 → ZFSet.{u} := Fin.cases T (Fin.cases S (fun _ => E))
301
- have ground : ∀ j, w j ∈ M.sets := Fin.cases fields.1 (Fin.cases fields.2.1 (fun _ => fields.2.2))
302
- exact ⟨w, ground, (actual w ground).2 ⟨oldCode, nonzero, code⟩⟩
303
-
304
- end TransitiveGround
305
-
306
- namespace SetFormula
307
- def preservedMainPrefixHistoryValuesFormula {n} (K Labels C D rD N p : Fin n) : SetFormula n :=
308
- let old := suffixIndex n 2
309
- let field := prefixIndex n 2
310
- allBlock 2 (imp (BoundedFormula.pairMembershipFormula (field 0) (field 1) (old p)).toFormula
311
- (preservedMainPrefixHistoryValueFormula (old K) (old Labels) (old C) (old D) (old rD) (old N)
312
- (field 0) (field 1)))
313
-
314
- def preservedMainPrefixHistoryCompatibilityFormula {n} (p : Fin n) : SetFormula n :=
315
- let old := suffixIndex n 4
316
- let field := prefixIndex n 4
317
- allBlock 4 (imp (BoundedFormula.conj
318
- (BoundedFormula.pairMembershipFormula (field 0) (field 2) (old p))
319
- (.conj (BoundedFormula.pairMembershipFormula (field 1) (field 3) (old p))
320
- (BoundedFormula.disj (.equal (field 0) (field 1)) (.mem (field 0) (field 1))))).toFormula
321
- (mainPrefixExtensionFormula (field 2) (field 3)))
322
-
323
- def preservedMainPrefixHistoryFormula {n} (K Labels C D rD N A p : Fin n) : SetFormula n :=
324
- .conj (functionGraphOnFormula A p)
325
- (.conj (preservedMainPrefixHistoryValuesFormula K Labels C D rD N p)
326
- (preservedMainPrefixHistoryCompatibilityFormula p))
327
-
328
- end SetFormula
329
-
330
- namespace TransitiveGround
331
- variable (M : TransitiveGround.{u})
332
-
333
- theorem realize_preservedMainPrefixHistoryValuesFormula
334
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
335
- (unions : Realize M.sets SetFormula.union Fin.elim0)
336
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
337
- (collection : CollectionSchema M.sets) {n} (K Labels C D rD N p : Fin n)
338
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
339
- (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) :
340
- Realize M.sets (preservedMainPrefixHistoryValuesFormula K Labels C D rD N p) env ↔
341
- ∀ i q, ZFSet.pair i q ∈ env p →
342
- ∃ S E, q = mainPrefixCode (insert i i) S E ∧
343
- MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (insert i i) S E ∧
344
- MainPrefixProfileGraphCode M (env K) (env Labels) (env C) (env D) (env rD) S E := by
345
- rw [preservedMainPrefixHistoryValuesFormula, realize_allBlock]
346
- have actual (f : Fin 2 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) :
347
- Realize M.sets
348
- (imp (BoundedFormula.pairMembershipFormula (prefixIndex n 2 0) (prefixIndex n 2 1)
349
- (suffixIndex n 2 p)).toFormula
350
- (preservedMainPrefixHistoryValueFormula (suffixIndex n 2 K) (suffixIndex n 2 Labels)
351
- (suffixIndex n 2 C) (suffixIndex n 2 D) (suffixIndex n 2 rD) (suffixIndex n 2 N)
352
- (prefixIndex n 2 0) (prefixIndex n 2 1))) (extendMany 2 f env) ↔
353
- (ZFSet.pair (f 0) (f 1) ∈ env p →
354
- ∃ S E, f 1 = mainPrefixCode (insert (f 0) (f 0)) S E ∧
355
- MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD)
356
- (insert (f 0) (f 0)) S E ∧
357
- MainPrefixProfileGraphCode M (env K) (env Labels) (env C) (env D) (env rD) S E) := by
358
- have mems := extendMany_members 2 f env ground members
359
- rw [realize_imp, BoundedFormula.realize_toFormula M _ _ mems,
360
- BoundedFormula.truth_pairMembershipFormula]
361
- rw [M.realize_preservedMainPrefixHistoryValueFormula pairing unions powers separation collection
362
- _ _ _ _ _ _ _ _ _ mems
363
- (by simpa only [extendMany_suffix] using omega)
364
- (by simpa only [extendMany_suffix] using ordinal)]
365
- simp only [extendMany_prefix, extendMany_suffix]
366
- constructor
367
- · intro recognized i q entry
368
- have ground := M.transitive (members p) entry
369
- let f : Fin 2 → ZFSet.{u} := Fin.cases i (fun _ => q)
370
- have grounds : ∀ j, f j ∈ M.sets := Fin.cases (M.pair_left ground) (fun _ => M.pair_right ground)
371
- exact (actual f grounds).1 (recognized f grounds) entry
372
- · intro law f ground
373
- exact (actual f ground).2 (law (f 0) (f 1))
374
-
375
- theorem realize_preservedMainPrefixHistoryCompatibilityFormula {n} (p : Fin n)
376
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
377
- Realize M.sets (preservedMainPrefixHistoryCompatibilityFormula p) env ↔
378
- ∀ i j q r, ZFSet.pair i q ∈ env p → ZFSet.pair j r ∈ env p →
379
- (i = j ∨ i ∈ j) → MainPrefixExtends q r := by
380
- rw [preservedMainPrefixHistoryCompatibilityFormula, realize_allBlock]
381
- have actual (f : Fin 4 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) :
382
- Realize M.sets (imp (BoundedFormula.conj
383
- (BoundedFormula.pairMembershipFormula (prefixIndex n 4 0) (prefixIndex n 4 2) (suffixIndex n 4 p))
384
- (.conj (BoundedFormula.pairMembershipFormula (prefixIndex n 4 1) (prefixIndex n 4 3) (suffixIndex n 4 p))
385
- (BoundedFormula.disj (.equal (prefixIndex n 4 0) (prefixIndex n 4 1))
386
- (.mem (prefixIndex n 4 0) (prefixIndex n 4 1))))).toFormula
387
- (mainPrefixExtensionFormula (prefixIndex n 4 2) (prefixIndex n 4 3))) (extendMany 4 f env) ↔
388
- ((ZFSet.pair (f 0) (f 2) ∈ env p ∧ ZFSet.pair (f 1) (f 3) ∈ env p ∧
389
- (f 0 = f 1 ∨ f 0 ∈ f 1)) → MainPrefixExtends (f 2) (f 3)) := by
390
- have mems := extendMany_members 4 f env ground members
391
- rw [realize_imp, BoundedFormula.realize_toFormula M _ _ mems]
392
- simp only [BoundedFormula.Truth, BoundedFormula.truth_pairMembershipFormula, BoundedFormula.truth_disj]
393
- rw [M.realize_mainPrefixExtensionFormula _ _ _ mems]
394
- simp only [extendMany_prefix, extendMany_suffix]
395
- constructor
396
- · intro recognized i j q r first second before
397
- have hfirst := M.transitive (members p) first
398
- have hsecond := M.transitive (members p) second
399
- let f : Fin 4 → ZFSet.{u} := Fin.cases i (Fin.cases j (Fin.cases q (fun _ => r)))
400
- have grounds : ∀ k, f k ∈ M.sets := Fin.cases (M.pair_left hfirst)
401
- (Fin.cases (M.pair_left hsecond) (Fin.cases (M.pair_right hfirst) (fun _ => M.pair_right hsecond)))
402
- exact (actual f grounds).1 (recognized f grounds) ⟨first, second, before⟩
403
- · intro law f ground
404
- exact (actual f ground).2 (fun entries => law (f 0) (f 1) (f 2) (f 3) entries.1 entries.2.1 entries.2.2)
405
-
406
- theorem realize_preservedMainPrefixHistoryFormula
407
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
408
- (unions : Realize M.sets SetFormula.union Fin.elim0)
409
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
410
- (collection : CollectionSchema M.sets) {n} (K Labels C D rD N A p : Fin n)
411
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
412
- (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) :
413
- Realize M.sets (preservedMainPrefixHistoryFormula K Labels C D rD N A p) env ↔
414
- PreservedMainPrefixHistoryCode M (env K) (env Labels) (env C) (env D) (env rD) (env A) (env p) := by
415
- change (Realize M.sets (functionGraphOnFormula A p) env ∧
416
- Realize M.sets (preservedMainPrefixHistoryValuesFormula K Labels C D rD N p) env ∧
417
- Realize M.sets (preservedMainPrefixHistoryCompatibilityFormula p) env) ↔ _
418
- rw [M.realize_functionGraphOnFormula unions A p env members,
419
- M.realize_preservedMainPrefixHistoryValuesFormula pairing unions powers separation collection
420
- K Labels C D rD N p env members omega ordinal,
421
- M.realize_preservedMainPrefixHistoryCompatibilityFormula p env members]
422
- exact ⟨fun h => ⟨h.1, h.2.1, h.2.2⟩, fun h => ⟨h.function, h.values, h.compatible⟩⟩
423
-
424
- end TransitiveGround
425
-
426
- end PartitionPilot.Forcing
427
-
428
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Forcing.MainPrefixConditionalStepCodes
2
+ import OAI.SetTheory.PartitionPrinciple.Transfinite.PreservedMainPrefixHistoryValues
3
+
4
+ namespace OAI
5
+
6
+ namespace PartitionPilot.Forcing
7
+
8
+ namespace BoundedFormula
9
+ open SetFormula
10
+ universe u
11
+
12
+ def nonzeroLimitOrdinalFormula {n} (T : Fin n) : BoundedFormula n :=
13
+ .conj (.neg (emptyFormula T)) (.allMem T (exMem T.succ (.mem 1 0)))
14
+
15
+ theorem truth_nonzeroLimitOrdinalFormula {n} (T : Fin n)
16
+ (env : Fin n → ZFSet.{u}) :
17
+ Truth (nonzeroLimitOrdinalFormula T) env ↔ NonzeroLimitOrdinalCode (env T) := by
18
+ simp only [nonzeroLimitOrdinalFormula, Truth, truth_emptyFormula, truth_exMem]
19
+ rfl
20
+
21
+ theorem realize_nonzeroLimitOrdinalFormula (M : TransitiveGround.{u}) {n}
22
+ (T : Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ i, env i ∈ M.sets) :
23
+ Realize M.sets (nonzeroLimitOrdinalFormula T).toFormula env ↔
24
+ NonzeroLimitOrdinalCode (env T) :=
25
+ (realize_toFormula M _ env members).trans (truth_nonzeroLimitOrdinalFormula T env)
26
+
27
+ end BoundedFormula
28
+
29
+ open SetFormula
30
+ universe u
31
+
32
+ namespace BoundedFormula
33
+ def mainPrefixFieldExtensionFormula {n} (T S E T' S' E' : Fin n) : BoundedFormula n :=
34
+ .conj (subsetFormula T T') (.conj (subsetFormula S S') (subsetFormula E E'))
35
+
36
+ theorem truth_mainPrefixFieldExtensionFormula {n} (T S E T' S' E' : Fin n)
37
+ (env : Fin n → ZFSet.{u}) :
38
+ Truth (mainPrefixFieldExtensionFormula T S E T' S' E') env ↔
39
+ env T ⊆ env T' ∧ env S ⊆ env S' ∧ env E ⊆ env E' := by
40
+ simp only [mainPrefixFieldExtensionFormula, Truth, truth_subsetFormula]
41
+
42
+ end BoundedFormula
43
+
44
+ namespace SetFormula
45
+ def mainPrefixExtensionFormula {n} (old next : Fin n) : SetFormula n :=
46
+ let outer := suffixIndex n 6
47
+ let field := prefixIndex n 6
48
+ exBlock 6 (.conj
49
+ (BoundedFormula.mainPrefixTupleFormula (outer old) (field 0) (field 1) (field 2)).toFormula
50
+ (.conj (BoundedFormula.mainPrefixTupleFormula (outer next) (field 3) (field 4) (field 5)).toFormula
51
+ (BoundedFormula.mainPrefixFieldExtensionFormula
52
+ (field 0) (field 1) (field 2) (field 3) (field 4) (field 5)).toFormula))
53
+
54
+ end SetFormula
55
+
56
+ namespace TransitiveGround
57
+ variable (M : TransitiveGround.{u})
58
+
59
+ theorem realize_mainPrefixExtensionFormula {n} (old next : Fin n)
60
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
61
+ Realize M.sets (mainPrefixExtensionFormula old next) env ↔
62
+ MainPrefixExtends (env old) (env next) := by
63
+ rw [mainPrefixExtensionFormula, realize_exBlock]
64
+ let outer := suffixIndex n 6
65
+ let field := prefixIndex n 6
66
+ have actual (f : Fin 6 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) :
67
+ (Realize M.sets (BoundedFormula.mainPrefixTupleFormula (outer old) (field 0) (field 1) (field 2)).toFormula
68
+ (extendMany 6 f env) ∧
69
+ Realize M.sets (BoundedFormula.mainPrefixTupleFormula (outer next) (field 3) (field 4) (field 5)).toFormula
70
+ (extendMany 6 f env) ∧
71
+ Realize M.sets (BoundedFormula.mainPrefixFieldExtensionFormula
72
+ (field 0) (field 1) (field 2) (field 3) (field 4) (field 5)).toFormula (extendMany 6 f env)) ↔
73
+ env old = mainPrefixCode (f 0) (f 1) (f 2) ∧
74
+ env next = mainPrefixCode (f 3) (f 4) (f 5) ∧ f 0 ⊆ f 3 ∧ f 1 ⊆ f 4 ∧ f 2 ⊆ f 5 := by
75
+ have mems := extendMany_members 6 f env ground members
76
+ rw [BoundedFormula.realize_mainPrefixTupleFormula M _ _ _ _ _ mems,
77
+ BoundedFormula.realize_mainPrefixTupleFormula M _ _ _ _ _ mems,
78
+ BoundedFormula.realize_toFormula M _ _ mems, BoundedFormula.truth_mainPrefixFieldExtensionFormula]
79
+ simp only [outer, field, extendMany_prefix, extendMany_suffix]
80
+ constructor
81
+ · rintro ⟨f, ground, clauses⟩
82
+ have result := (actual f ground).1 clauses
83
+ exact ⟨f 0, f 1, f 2, f 3, f 4, f 5, result⟩
84
+ · rintro ⟨T, S, E, U, F, G, first, second, indices, stages, transitions⟩
85
+ have left := M.mainPrefixCode_fields_mem (first ▸ members old)
86
+ have right := M.mainPrefixCode_fields_mem (second ▸ members next)
87
+ let f : Fin 6 → ZFSet.{u} := Fin.cases T (Fin.cases S (Fin.cases E
88
+ (Fin.cases U (Fin.cases F (fun _ => G)))))
89
+ have ground : ∀ j, f j ∈ M.sets := Fin.cases left.1 (Fin.cases left.2.1
90
+ (Fin.cases left.2.2 (Fin.cases right.1 (Fin.cases right.2.1 (fun _ => right.2.2)))))
91
+ exact ⟨f, ground, (actual f ground).2 ⟨first, second, indices, stages, transitions⟩⟩
92
+
93
+ end TransitiveGround
94
+
95
+ namespace SetFormula
96
+
97
+ def mainPrefixLimitStepRawFormula {n} (K Labels C D rD N old next : Fin n)
98
+ (w : Fin 32 → Fin n) : SetFormula n :=
99
+ let v := mainPrefixLimitTargetFields w
100
+ .conj (BoundedFormula.successorFormula (w 7) (w 0)).toFormula
101
+ (.conj (BoundedFormula.mainPrefixTupleFormula old (w 0) (w 1) (w 2)).toFormula
102
+ (.conj (BoundedFormula.mainPrefixTupleFormula next (w 7) (w 3) (w 4)).toFormula
103
+ (.conj (mainPrefixExtensionFormula old next)
104
+ (.conj (BoundedFormula.pairMembershipFormula (w 0) (w 5) (w 3)).toFormula
105
+ (.conj (linkedMainStageRawFormula K Labels C D rD N (w 5) v)
106
+ (.conj (BoundedFormula.pairMembershipFormula (v 11) (w 6) (v 17)).toFormula
107
+ (BoundedFormula.mainLimitCoverageFormula (w 0) (w 1) (w 4)
108
+ (v 0) (v 3) (v 1) (v 9) (v 11) (w 6)).toFormula))))))
109
+
110
+ def mainPrefixLimitStepFormula {n} (K Labels C D rD N old next : Fin n) : SetFormula n :=
111
+ let outer := suffixIndex n 32
112
+ exBlock 32 (mainPrefixLimitStepRawFormula (outer K) (outer Labels) (outer C)
113
+ (outer D) (outer rD) (outer N) (outer old) (outer next) (prefixIndex n 32))
114
+
115
+ end SetFormula
116
+
117
+ namespace TransitiveGround
118
+ variable (M : TransitiveGround.{u})
119
+
120
+ theorem realize_mainPrefixLimitStepRawFormula
121
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
122
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
123
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
124
+ (collection : CollectionSchema M.sets) {n} (K Labels C D rD N old next : Fin n)
125
+ (w : Fin 32 → Fin n) (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
126
+ (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) :
127
+ Realize M.sets (mainPrefixLimitStepRawFormula K Labels C D rD N old next w) env ↔
128
+ MainPrefixLimitStepRawCode M (env K) (env Labels) (env C) (env D) (env rD) (env N)
129
+ (env old) (env next) (fun j => env (w j)) := by
130
+ have linked := M.realize_linkedMainStageRawFormula pairing unions powers separation collection
131
+ K Labels C D rD N (w 5) (mainPrefixLimitTargetFields w) env members omega ordinal
132
+ have extension := M.realize_mainPrefixExtensionFormula old next env members
133
+ simp only [mainPrefixLimitStepRawFormula, Realize, BoundedFormula.realize_toFormula M _ env members,
134
+ BoundedFormula.truth_successorFormula, BoundedFormula.truth_mainPrefixTupleFormula,
135
+ extension, BoundedFormula.truth_pairMembershipFormula, linked,
136
+ BoundedFormula.truth_mainLimitCoverageFormula]
137
+ rfl
138
+
139
+ theorem realize_mainPrefixLimitStepFormula
140
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
141
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
142
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
143
+ (collection : CollectionSchema M.sets) {n} (K Labels C D rD N old next : Fin n)
144
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
145
+ (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) :
146
+ Realize M.sets (mainPrefixLimitStepFormula K Labels C D rD N old next) env ↔
147
+ MainPrefixLimitStepCode M (env K) (env Labels) (env C) (env D) (env rD) (env N)
148
+ (env old) (env next) := by
149
+ rw [mainPrefixLimitStepFormula, realize_exBlock]
150
+ have actual (w : Fin 32 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) :=
151
+ M.realize_mainPrefixLimitStepRawFormula pairing unions powers separation collection
152
+ (suffixIndex n 32 K) (suffixIndex n 32 Labels) (suffixIndex n 32 C) (suffixIndex n 32 D)
153
+ (suffixIndex n 32 rD) (suffixIndex n 32 N) (suffixIndex n 32 old) (suffixIndex n 32 next)
154
+ (prefixIndex n 32) (extendMany 32 w env) (extendMany_members 32 w env ground members)
155
+ (by simpa only [extendMany_suffix] using omega)
156
+ (by simpa only [extendMany_suffix] using ordinal)
157
+ simp only [extendMany_prefix, extendMany_suffix] at actual
158
+ exact ⟨fun ⟨w, ground, recognized⟩ => ⟨w, ground, (actual w ground).1 recognized⟩,
159
+ fun ⟨w, ground, raw⟩ => ⟨w, ground, (actual w ground).2 raw⟩⟩
160
+
161
+ end TransitiveGround
162
+
163
+ namespace BoundedFormula
164
+ def mainPrefixSelectedStepBody {n} (f old next : Fin n) (v : Fin 10 → Fin n) : BoundedFormula n :=
165
+ .conj (successorFormula (v 8) (v 0))
166
+ (.conj (successorFormula (v 9) (v 8))
167
+ (.conj (mainPrefixTupleFormula old (v 8) (v 1) (v 2))
168
+ (.conj (mainPrefixTupleFormula next (v 9) (v 3) (v 4))
169
+ (.conj (mainPrefixFieldExtensionFormula (v 8) (v 1) (v 2) (v 9) (v 3) (v 4))
170
+ (.conj (pairMembershipFormula (v 0) (v 5) (v 1))
171
+ (.conj (rightTripleMembershipFormula (v 5) (v 6) (v 7) f)
172
+ (.conj (pairMembershipFormula (v 8) (v 6) (v 3))
173
+ (tripleMembershipFormula (v 8) (v 0) (v 7) (v 4)))))))))
174
+
175
+ theorem truth_mainPrefixSelectedStepBody {n} (f old next : Fin n) (v : Fin 10 → Fin n)
176
+ (env : Fin n → ZFSet.{u}) :
177
+ Truth (mainPrefixSelectedStepBody f old next v) env ↔
178
+ env (v 8) = insert (env (v 0)) (env (v 0)) ∧
179
+ env (v 9) = insert (env (v 8)) (env (v 8)) ∧
180
+ env old = mainPrefixCode (env (v 8)) (env (v 1)) (env (v 2)) ∧
181
+ env next = mainPrefixCode (env (v 9)) (env (v 3)) (env (v 4)) ∧
182
+ (env (v 8) ⊆ env (v 9) ∧ env (v 1) ⊆ env (v 3) ∧ env (v 2) ⊆ env (v 4)) ∧
183
+ ZFSet.pair (env (v 0)) (env (v 5)) ∈ env (v 1) ∧
184
+ ZFSet.pair (env (v 5)) (ZFSet.pair (env (v 6)) (env (v 7))) ∈ env f ∧
185
+ ZFSet.pair (env (v 8)) (env (v 6)) ∈ env (v 3) ∧
186
+ ZFSet.pair (ZFSet.pair (env (v 8)) (env (v 0))) (env (v 7)) ∈ env (v 4) := by
187
+ simp only [mainPrefixSelectedStepBody, Truth, truth_successorFormula,
188
+ truth_mainPrefixTupleFormula, truth_mainPrefixFieldExtensionFormula,
189
+ truth_pairMembershipFormula, truth_rightTripleMembershipFormula, truth_tripleMembershipFormula]
190
+
191
+ end BoundedFormula
192
+
193
+ namespace SetFormula
194
+ def mainPrefixSelectedStepFormula {n} (f old next : Fin n) : SetFormula n :=
195
+ exBlock 10 (BoundedFormula.mainPrefixSelectedStepBody
196
+ (suffixIndex n 10 f) (suffixIndex n 10 old) (suffixIndex n 10 next)
197
+ (prefixIndex n 10)).toFormula
198
+
199
+ end SetFormula
200
+
201
+ namespace TransitiveGround
202
+ variable (M : TransitiveGround.{u})
203
+
204
+ theorem realize_mainPrefixSelectedStepFormula {n} (f old next : Fin n)
205
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
206
+ Realize M.sets (mainPrefixSelectedStepFormula f old next) env ↔
207
+ MainPrefixSelectedStepCode (env f) (env old) (env next) := by
208
+ rw [mainPrefixSelectedStepFormula, realize_exBlock]
209
+ have actual (v : Fin 10 → ZFSet.{u}) (ground : ∀ j, v j ∈ M.sets) :=
210
+ (BoundedFormula.realize_toFormula M _ (extendMany 10 v env)
211
+ (extendMany_members 10 v env ground members)).trans
212
+ (BoundedFormula.truth_mainPrefixSelectedStepBody
213
+ (suffixIndex n 10 f) (suffixIndex n 10 old) (suffixIndex n 10 next)
214
+ (prefixIndex n 10) (extendMany 10 v env))
215
+ simp only [extendMany_prefix, extendMany_suffix] at actual
216
+ constructor
217
+ · rintro ⟨v, ground, recognized⟩
218
+ obtain ⟨first, second, oldCode, nextCode, extension, source, selected, target, crossing⟩ :=
219
+ (actual v ground).1 recognized
220
+ refine ⟨v 0, v 1, v 2, v 3, v 4, v 5, v 6, v 7, ?_, ?_, ?_, source, selected, ?_, ?_⟩
221
+ · simpa only [first] using oldCode
222
+ · simpa only [second, first] using nextCode
223
+ · rw [oldCode, nextCode]
224
+ exact mainPrefixExtends_iff.2 extension
225
+ · simpa only [first] using target
226
+ · simpa only [first] using crossing
227
+ · rintro ⟨b, S, E, S', E', a, target, z, oldCode, nextCode,
228
+ extension, source, selected, targetEntry, crossing⟩
229
+ have left := M.mainPrefixCode_fields_mem (oldCode ▸ members old)
230
+ have right := M.mainPrefixCode_fields_mem (nextCode ▸ members next)
231
+ have sourceGround := M.transitive left.2.1 source
232
+ have selectedGround := M.transitive (members f) selected
233
+ let v : Fin 10 → ZFSet.{u} := Fin.cases b (Fin.cases S (Fin.cases E
234
+ (Fin.cases S' (Fin.cases E' (Fin.cases a (Fin.cases target (Fin.cases z
235
+ (Fin.cases (insert b b) (fun _ => insert (insert b b) (insert b b))))))))))
236
+ have ground : ∀ j, v j ∈ M.sets := Fin.cases (M.pair_left sourceGround)
237
+ (Fin.cases left.2.1 (Fin.cases left.2.2 (Fin.cases right.2.1 (Fin.cases right.2.2
238
+ (Fin.cases (M.pair_right sourceGround) (Fin.cases (M.pair_left (M.pair_right selectedGround))
239
+ (Fin.cases (M.pair_right (M.pair_right selectedGround)) (Fin.cases left.1 (fun _ => right.1)))))))))
240
+ rw [oldCode, nextCode] at extension
241
+ exact ⟨v, ground, (actual v ground).2 ⟨rfl, rfl, oldCode, nextCode,
242
+ mainPrefixExtends_iff.1 extension, source, selected, targetEntry, crossing⟩⟩
243
+
244
+ end TransitiveGround
245
+
246
+ namespace SetFormula
247
+ def mainPrefixConditionalStepFormula {n} (K Labels C D rD N f old next : Fin n) : SetFormula n :=
248
+ let outer := suffixIndex n 3
249
+ let field := prefixIndex n 3
250
+ disj (mainPrefixSelectedStepFormula f old next)
251
+ (exBlock 3 (.conj
252
+ (BoundedFormula.mainPrefixTupleFormula (outer old) (field 0) (field 1) (field 2)).toFormula
253
+ (.conj (BoundedFormula.nonzeroLimitOrdinalFormula (field 0)).toFormula
254
+ (mainPrefixLimitStepFormula (outer K) (outer Labels) (outer C) (outer D)
255
+ (outer rD) (outer N) (outer old) (outer next)))))
256
+
257
+ end SetFormula
258
+
259
+ namespace TransitiveGround
260
+ variable (M : TransitiveGround.{u})
261
+
262
+ theorem realize_mainPrefixConditionalStepFormula
263
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
264
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
265
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
266
+ (collection : CollectionSchema M.sets) {n}
267
+ (K Labels C D rD N f old next : Fin n) (env : Fin n → ZFSet.{u})
268
+ (members : ∀ j, env j ∈ M.sets) (omega : env N = ZFSet.omega)
269
+ (ordinal : ordinalSetProperty (env K)) :
270
+ Realize M.sets (mainPrefixConditionalStepFormula K Labels C D rD N f old next) env ↔
271
+ MainPrefixConditionalStepCode M (env K) (env Labels) (env C) (env D) (env rD)
272
+ (env N) (env f) (env old) (env next) := by
273
+ rw [mainPrefixConditionalStepFormula, realize_disj,
274
+ M.realize_mainPrefixSelectedStepFormula f old next env members, realize_exBlock]
275
+ apply or_congr Iff.rfl
276
+ let outer := suffixIndex n 3
277
+ let field := prefixIndex n 3
278
+ have actual (w : Fin 3 → ZFSet.{u}) (ground : ∀ j, w j ∈ M.sets) :
279
+ Realize M.sets (.conj
280
+ (BoundedFormula.mainPrefixTupleFormula (outer old) (field 0) (field 1) (field 2)).toFormula
281
+ (.conj (BoundedFormula.nonzeroLimitOrdinalFormula (field 0)).toFormula
282
+ (mainPrefixLimitStepFormula (outer K) (outer Labels) (outer C) (outer D)
283
+ (outer rD) (outer N) (outer old) (outer next)))) (extendMany 3 w env) ↔
284
+ env old = mainPrefixCode (w 0) (w 1) (w 2) ∧ NonzeroLimitOrdinalCode (w 0) ∧
285
+ MainPrefixLimitStepCode M (env K) (env Labels) (env C) (env D) (env rD) (env N)
286
+ (env old) (env next) := by
287
+ have mems := extendMany_members 3 w env ground members
288
+ change (Realize M.sets _ _ ∧ Realize M.sets _ _ ∧ Realize M.sets _ _) ↔ _
289
+ rw [BoundedFormula.realize_mainPrefixTupleFormula M _ _ _ _ _ mems,
290
+ BoundedFormula.realize_nonzeroLimitOrdinalFormula M _ _ mems,
291
+ M.realize_mainPrefixLimitStepFormula pairing unions powers separation collection
292
+ _ _ _ _ _ _ _ _ _ mems (by simpa only [outer, extendMany_suffix] using omega)
293
+ (by simpa only [outer, extendMany_suffix] using ordinal)]
294
+ simp only [outer, field, extendMany_suffix, extendMany_prefix]
295
+ constructor
296
+ · rintro ⟨w, ground, recognized⟩
297
+ exact ⟨w 0, w 1, w 2, (actual w ground).1 recognized⟩
298
+ · rintro ⟨T, S, E, oldCode, nonzero, code⟩
299
+ have fields := M.mainPrefixCode_fields_mem (oldCode ▸ members old)
300
+ let w : Fin 3 → ZFSet.{u} := Fin.cases T (Fin.cases S (fun _ => E))
301
+ have ground : ∀ j, w j ∈ M.sets := Fin.cases fields.1 (Fin.cases fields.2.1 (fun _ => fields.2.2))
302
+ exact ⟨w, ground, (actual w ground).2 ⟨oldCode, nonzero, code⟩⟩
303
+
304
+ end TransitiveGround
305
+
306
+ namespace SetFormula
307
+ def preservedMainPrefixHistoryValuesFormula {n} (K Labels C D rD N p : Fin n) : SetFormula n :=
308
+ let old := suffixIndex n 2
309
+ let field := prefixIndex n 2
310
+ allBlock 2 (imp (BoundedFormula.pairMembershipFormula (field 0) (field 1) (old p)).toFormula
311
+ (preservedMainPrefixHistoryValueFormula (old K) (old Labels) (old C) (old D) (old rD) (old N)
312
+ (field 0) (field 1)))
313
+
314
+ def preservedMainPrefixHistoryCompatibilityFormula {n} (p : Fin n) : SetFormula n :=
315
+ let old := suffixIndex n 4
316
+ let field := prefixIndex n 4
317
+ allBlock 4 (imp (BoundedFormula.conj
318
+ (BoundedFormula.pairMembershipFormula (field 0) (field 2) (old p))
319
+ (.conj (BoundedFormula.pairMembershipFormula (field 1) (field 3) (old p))
320
+ (BoundedFormula.disj (.equal (field 0) (field 1)) (.mem (field 0) (field 1))))).toFormula
321
+ (mainPrefixExtensionFormula (field 2) (field 3)))
322
+
323
+ def preservedMainPrefixHistoryFormula {n} (K Labels C D rD N A p : Fin n) : SetFormula n :=
324
+ .conj (functionGraphOnFormula A p)
325
+ (.conj (preservedMainPrefixHistoryValuesFormula K Labels C D rD N p)
326
+ (preservedMainPrefixHistoryCompatibilityFormula p))
327
+
328
+ end SetFormula
329
+
330
+ namespace TransitiveGround
331
+ variable (M : TransitiveGround.{u})
332
+
333
+ theorem realize_preservedMainPrefixHistoryValuesFormula
334
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
335
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
336
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
337
+ (collection : CollectionSchema M.sets) {n} (K Labels C D rD N p : Fin n)
338
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
339
+ (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) :
340
+ Realize M.sets (preservedMainPrefixHistoryValuesFormula K Labels C D rD N p) env ↔
341
+ ∀ i q, ZFSet.pair i q ∈ env p →
342
+ ∃ S E, q = mainPrefixCode (insert i i) S E ∧
343
+ MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD) (insert i i) S E ∧
344
+ MainPrefixProfileGraphCode M (env K) (env Labels) (env C) (env D) (env rD) S E := by
345
+ rw [preservedMainPrefixHistoryValuesFormula, realize_allBlock]
346
+ have actual (f : Fin 2 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) :
347
+ Realize M.sets
348
+ (imp (BoundedFormula.pairMembershipFormula (prefixIndex n 2 0) (prefixIndex n 2 1)
349
+ (suffixIndex n 2 p)).toFormula
350
+ (preservedMainPrefixHistoryValueFormula (suffixIndex n 2 K) (suffixIndex n 2 Labels)
351
+ (suffixIndex n 2 C) (suffixIndex n 2 D) (suffixIndex n 2 rD) (suffixIndex n 2 N)
352
+ (prefixIndex n 2 0) (prefixIndex n 2 1))) (extendMany 2 f env) ↔
353
+ (ZFSet.pair (f 0) (f 1) ∈ env p →
354
+ ∃ S E, f 1 = mainPrefixCode (insert (f 0) (f 0)) S E ∧
355
+ MainPrefixGraphCode M (env K) (env Labels) (env C) (env D) (env rD)
356
+ (insert (f 0) (f 0)) S E ∧
357
+ MainPrefixProfileGraphCode M (env K) (env Labels) (env C) (env D) (env rD) S E) := by
358
+ have mems := extendMany_members 2 f env ground members
359
+ rw [realize_imp, BoundedFormula.realize_toFormula M _ _ mems,
360
+ BoundedFormula.truth_pairMembershipFormula]
361
+ rw [M.realize_preservedMainPrefixHistoryValueFormula pairing unions powers separation collection
362
+ _ _ _ _ _ _ _ _ _ mems
363
+ (by simpa only [extendMany_suffix] using omega)
364
+ (by simpa only [extendMany_suffix] using ordinal)]
365
+ simp only [extendMany_prefix, extendMany_suffix]
366
+ constructor
367
+ · intro recognized i q entry
368
+ have ground := M.transitive (members p) entry
369
+ let f : Fin 2 → ZFSet.{u} := Fin.cases i (fun _ => q)
370
+ have grounds : ∀ j, f j ∈ M.sets := Fin.cases (M.pair_left ground) (fun _ => M.pair_right ground)
371
+ exact (actual f grounds).1 (recognized f grounds) entry
372
+ · intro law f ground
373
+ exact (actual f ground).2 (law (f 0) (f 1))
374
+
375
+ theorem realize_preservedMainPrefixHistoryCompatibilityFormula {n} (p : Fin n)
376
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
377
+ Realize M.sets (preservedMainPrefixHistoryCompatibilityFormula p) env ↔
378
+ ∀ i j q r, ZFSet.pair i q ∈ env p → ZFSet.pair j r ∈ env p →
379
+ (i = j ∨ i ∈ j) → MainPrefixExtends q r := by
380
+ rw [preservedMainPrefixHistoryCompatibilityFormula, realize_allBlock]
381
+ have actual (f : Fin 4 → ZFSet.{u}) (ground : ∀ j, f j ∈ M.sets) :
382
+ Realize M.sets (imp (BoundedFormula.conj
383
+ (BoundedFormula.pairMembershipFormula (prefixIndex n 4 0) (prefixIndex n 4 2) (suffixIndex n 4 p))
384
+ (.conj (BoundedFormula.pairMembershipFormula (prefixIndex n 4 1) (prefixIndex n 4 3) (suffixIndex n 4 p))
385
+ (BoundedFormula.disj (.equal (prefixIndex n 4 0) (prefixIndex n 4 1))
386
+ (.mem (prefixIndex n 4 0) (prefixIndex n 4 1))))).toFormula
387
+ (mainPrefixExtensionFormula (prefixIndex n 4 2) (prefixIndex n 4 3))) (extendMany 4 f env) ↔
388
+ ((ZFSet.pair (f 0) (f 2) ∈ env p ∧ ZFSet.pair (f 1) (f 3) ∈ env p ∧
389
+ (f 0 = f 1 ∨ f 0 ∈ f 1)) → MainPrefixExtends (f 2) (f 3)) := by
390
+ have mems := extendMany_members 4 f env ground members
391
+ rw [realize_imp, BoundedFormula.realize_toFormula M _ _ mems]
392
+ simp only [BoundedFormula.Truth, BoundedFormula.truth_pairMembershipFormula, BoundedFormula.truth_disj]
393
+ rw [M.realize_mainPrefixExtensionFormula _ _ _ mems]
394
+ simp only [extendMany_prefix, extendMany_suffix]
395
+ constructor
396
+ · intro recognized i j q r first second before
397
+ have hfirst := M.transitive (members p) first
398
+ have hsecond := M.transitive (members p) second
399
+ let f : Fin 4 → ZFSet.{u} := Fin.cases i (Fin.cases j (Fin.cases q (fun _ => r)))
400
+ have grounds : ∀ k, f k ∈ M.sets := Fin.cases (M.pair_left hfirst)
401
+ (Fin.cases (M.pair_left hsecond) (Fin.cases (M.pair_right hfirst) (fun _ => M.pair_right hsecond)))
402
+ exact (actual f grounds).1 (recognized f grounds) ⟨first, second, before⟩
403
+ · intro law f ground
404
+ exact (actual f ground).2 (fun entries => law (f 0) (f 1) (f 2) (f 3) entries.1 entries.2.1 entries.2.2)
405
+
406
+ theorem realize_preservedMainPrefixHistoryFormula
407
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
408
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
409
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
410
+ (collection : CollectionSchema M.sets) {n} (K Labels C D rD N A p : Fin n)
411
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
412
+ (omega : env N = ZFSet.omega) (ordinal : ordinalSetProperty (env K)) :
413
+ Realize M.sets (preservedMainPrefixHistoryFormula K Labels C D rD N A p) env ↔
414
+ PreservedMainPrefixHistoryCode M (env K) (env Labels) (env C) (env D) (env rD) (env A) (env p) := by
415
+ change (Realize M.sets (functionGraphOnFormula A p) env ∧
416
+ Realize M.sets (preservedMainPrefixHistoryValuesFormula K Labels C D rD N p) env ∧
417
+ Realize M.sets (preservedMainPrefixHistoryCompatibilityFormula p) env) ↔ _
418
+ rw [M.realize_functionGraphOnFormula unions A p env members,
419
+ M.realize_preservedMainPrefixHistoryValuesFormula pairing unions powers separation collection
420
+ K Labels C D rD N p env members omega ordinal,
421
+ M.realize_preservedMainPrefixHistoryCompatibilityFormula p env members]
422
+ exact ⟨fun h => ⟨h.1, h.2.1, h.2.2⟩, fun h => ⟨h.function, h.values, h.compatible⟩⟩
423
+
424
+ end TransitiveGround
425
+
426
+ end PartitionPilot.Forcing
427
+
428
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/PrincipalSupportFormulas.lean CHANGED
@@ -1,76 +1,76 @@
1
- import OAI.SetTheory.PartitionPrinciple.Forcing.FinitePrincipalNameSupports
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing.BoundedFormula
8
-
9
- open SetFormula SetRealization
10
- universe u
11
-
12
- def principalSupportFormula {n} (g c l r a : Fin n) : BoundedFormula n :=
13
- .allMem l (imp (pairMembershipFormula 0 c.succ r.succ)
14
- (tripleMembershipFormula g.succ 0 0 a.succ))
15
-
16
- def principalSupportEntryFormula {n} (z l g r a : Fin n) : BoundedFormula n :=
17
- exMem l (exMem g.succ (.conj (orderedPairFormula z.succ.succ 1 0)
18
- (principalSupportFormula 0 1 l.succ.succ r.succ.succ a.succ.succ)))
19
-
20
- theorem truth_principalSupportFormula {n} (g c l r a : Fin n) (env : Fin n → ZFSet.{u}) :
21
- Truth (principalSupportFormula g c l r a) env ↔
22
- ∀ x ∈ env l, ZFSet.pair x (env c) ∈ env r → ZFSet.pair (ZFSet.pair (env g) x) x ∈ env a := by
23
- simp only [principalSupportFormula, Truth, truth_imp, truth_pairMembershipFormula,
24
- truth_tripleMembershipFormula]
25
- rfl
26
-
27
- theorem truth_principalSupportEntryFormula {n} (z l g r a : Fin n) (env : Fin n → ZFSet.{u}) :
28
- Truth (principalSupportEntryFormula z l g r a) env ↔
29
- ∃ c ∈ env l, ∃ h ∈ env g, env z = ZFSet.pair c h ∧
30
- ∀ x ∈ env l, ZFSet.pair x c ∈ env r → ZFSet.pair (ZFSet.pair h x) x ∈ env a := by
31
- simp only [principalSupportEntryFormula, truth_exMem, Truth, truth_orderedPairFormula,
32
- truth_principalSupportFormula]
33
- rfl
34
-
35
- variable {G I : Type u} [Group G] [PartialOrder I]
36
-
37
- theorem principalSupport_correct (d : PosetAction G I) (b : Presentation I) (t : Presentation G)
38
- (C : I) (g : G) :
39
- Truth (principalSupportFormula 0 1 2 3 4)
40
- (extend (t.encode g) (extend (b.encode C) (extend b.carrier
41
- (extend b.conditionOrder (extend (d.actionGraph b t) Fin.elim0))))) ↔ g ∈ d.principalFix C := by
42
- rw [truth_principalSupportFormula]
43
- constructor
44
- · intro fixed x lower
45
- exact (d.triple_mem_actionGraph b t g x x).1
46
- (fixed _ (b.encode_mem x) ((b.pair_mem_conditionOrder x C).2 lower))
47
- · intro fixed x hx lower
48
- obtain ⟨y, rfl⟩ := (b.mem_carrier x).1 hx
49
- exact (d.triple_mem_actionGraph b t g y y).2 (fixed y ((b.pair_mem_conditionOrder y C).1 lower))
50
-
51
- theorem principalSupportEntry_correct (d : PosetAction G I) (b : Presentation I) (t : Presentation G)
52
- (z : ZFSet.{u}) :
53
- Truth (principalSupportEntryFormula 0 1 2 3 4)
54
- (extend z (extend b.carrier (extend t.carrier
55
- (extend b.conditionOrder (extend (d.actionGraph b t) Fin.elim0))))) ↔
56
- z ∈ supportBasisCode b t d.principalFix := by
57
- rw [truth_principalSupportEntryFormula, supportBasisCode, Presentation.mem_subset]
58
- constructor
59
- · rintro ⟨c, hc, h, hh, eq, fixed⟩
60
- obtain ⟨C, rfl⟩ := (b.mem_carrier c).1 hc
61
- obtain ⟨g, rfl⟩ := (t.mem_carrier h).1 hh
62
- refine ⟨(C, g), ?_, eq.symm⟩
63
- intro x lower
64
- exact (d.triple_mem_actionGraph b t g x x).1
65
- (fixed _ (b.encode_mem x) ((b.pair_mem_conditionOrder x C).2 lower))
66
- · rintro ⟨⟨C, g⟩, fixed, eq⟩
67
- refine ⟨b.encode C, b.encode_mem C, t.encode g, t.encode_mem g, eq.symm, ?_⟩
68
- intro x hx lower
69
- obtain ⟨y, rfl⟩ := (b.mem_carrier x).1 hx
70
- exact (d.triple_mem_actionGraph b t g y y).2 (fixed y ((b.pair_mem_conditionOrder y C).1 lower))
71
-
72
- end PartitionPilot.Forcing.BoundedFormula
73
-
74
- end
75
-
76
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Forcing.FinitePrincipalNameSupports
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing.BoundedFormula
8
+
9
+ open SetFormula SetRealization
10
+ universe u
11
+
12
+ def principalSupportFormula {n} (g c l r a : Fin n) : BoundedFormula n :=
13
+ .allMem l (imp (pairMembershipFormula 0 c.succ r.succ)
14
+ (tripleMembershipFormula g.succ 0 0 a.succ))
15
+
16
+ def principalSupportEntryFormula {n} (z l g r a : Fin n) : BoundedFormula n :=
17
+ exMem l (exMem g.succ (.conj (orderedPairFormula z.succ.succ 1 0)
18
+ (principalSupportFormula 0 1 l.succ.succ r.succ.succ a.succ.succ)))
19
+
20
+ theorem truth_principalSupportFormula {n} (g c l r a : Fin n) (env : Fin n → ZFSet.{u}) :
21
+ Truth (principalSupportFormula g c l r a) env ↔
22
+ ∀ x ∈ env l, ZFSet.pair x (env c) ∈ env r → ZFSet.pair (ZFSet.pair (env g) x) x ∈ env a := by
23
+ simp only [principalSupportFormula, Truth, truth_imp, truth_pairMembershipFormula,
24
+ truth_tripleMembershipFormula]
25
+ rfl
26
+
27
+ theorem truth_principalSupportEntryFormula {n} (z l g r a : Fin n) (env : Fin n → ZFSet.{u}) :
28
+ Truth (principalSupportEntryFormula z l g r a) env ↔
29
+ ∃ c ∈ env l, ∃ h ∈ env g, env z = ZFSet.pair c h ∧
30
+ ∀ x ∈ env l, ZFSet.pair x c ∈ env r → ZFSet.pair (ZFSet.pair h x) x ∈ env a := by
31
+ simp only [principalSupportEntryFormula, truth_exMem, Truth, truth_orderedPairFormula,
32
+ truth_principalSupportFormula]
33
+ rfl
34
+
35
+ variable {G I : Type u} [Group G] [PartialOrder I]
36
+
37
+ theorem principalSupport_correct (d : PosetAction G I) (b : Presentation I) (t : Presentation G)
38
+ (C : I) (g : G) :
39
+ Truth (principalSupportFormula 0 1 2 3 4)
40
+ (extend (t.encode g) (extend (b.encode C) (extend b.carrier
41
+ (extend b.conditionOrder (extend (d.actionGraph b t) Fin.elim0))))) ↔ g ∈ d.principalFix C := by
42
+ rw [truth_principalSupportFormula]
43
+ constructor
44
+ · intro fixed x lower
45
+ exact (d.triple_mem_actionGraph b t g x x).1
46
+ (fixed _ (b.encode_mem x) ((b.pair_mem_conditionOrder x C).2 lower))
47
+ · intro fixed x hx lower
48
+ obtain ⟨y, rfl⟩ := (b.mem_carrier x).1 hx
49
+ exact (d.triple_mem_actionGraph b t g y y).2 (fixed y ((b.pair_mem_conditionOrder y C).1 lower))
50
+
51
+ theorem principalSupportEntry_correct (d : PosetAction G I) (b : Presentation I) (t : Presentation G)
52
+ (z : ZFSet.{u}) :
53
+ Truth (principalSupportEntryFormula 0 1 2 3 4)
54
+ (extend z (extend b.carrier (extend t.carrier
55
+ (extend b.conditionOrder (extend (d.actionGraph b t) Fin.elim0))))) ↔
56
+ z ∈ supportBasisCode b t d.principalFix := by
57
+ rw [truth_principalSupportEntryFormula, supportBasisCode, Presentation.mem_subset]
58
+ constructor
59
+ · rintro ⟨c, hc, h, hh, eq, fixed⟩
60
+ obtain ⟨C, rfl⟩ := (b.mem_carrier c).1 hc
61
+ obtain ⟨g, rfl⟩ := (t.mem_carrier h).1 hh
62
+ refine ⟨(C, g), ?_, eq.symm⟩
63
+ intro x lower
64
+ exact (d.triple_mem_actionGraph b t g x x).1
65
+ (fixed _ (b.encode_mem x) ((b.pair_mem_conditionOrder x C).2 lower))
66
+ · rintro ⟨⟨C, g⟩, fixed, eq⟩
67
+ refine ⟨b.encode C, b.encode_mem C, t.encode g, t.encode_mem g, eq.symm, ?_⟩
68
+ intro x hx lower
69
+ obtain ⟨y, rfl⟩ := (b.mem_carrier x).1 hx
70
+ exact (d.triple_mem_actionGraph b t g y y).2 (fixed y ((b.pair_mem_conditionOrder y C).1 lower))
71
+
72
+ end PartitionPilot.Forcing.BoundedFormula
73
+
74
+ end
75
+
76
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/PrincipalTileRealization.lean CHANGED
@@ -1,75 +1,75 @@
1
- import OAI.SetTheory.PartitionPrinciple.Geometry.SeparationTileCodes
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing.CodedPrincipalTile
8
- open Compression.RecursiveMaps
9
- universe u
10
- variable {P Q rP rQ μP μQ ell : ZFSet.{u}}
11
- variable {old : MeetOrderCode P rP μP} {right : MeetOrderCode Q rQ μQ}
12
- variable {g : PrincipalAmalgamation.Input old.toMeetOrder right.toMeetOrder}
13
- variable (d : CodedPrincipalTile old right g ell)
14
-
15
- noncomputable def decode (x : {x : ZFSet.{u} // x ∈ d.carrier}) : g.Node :=
16
- Classical.choose (d.encode_surjective x.val x.property)
17
-
18
- theorem encode_decode (x : {x : ZFSet.{u} // x ∈ d.carrier}) : d.encode (d.decode x) = x.val :=
19
- Classical.choose_spec (d.encode_surjective x.val x.property)
20
-
21
- theorem decode_encode (x : g.Node) : d.decode ⟨d.encode x, d.encode_mem x⟩ = x :=
22
- d.encode_injective (d.encode_decode _)
23
-
24
- noncomputable def encodingIso : Compression.MeetIso g.order d.meetOrder.toMeetOrder :=
25
- isoOfOrder (fun x => ⟨d.encode x, d.encode_mem x⟩) d.decode d.decode_encode
26
- (fun x => Subtype.ext (d.encode_decode x)) d.le_encode
27
-
28
- noncomputable def decodingIso : Compression.MeetIso d.meetOrder.toMeetOrder g.order :=
29
- inverseIso d.encodingIso
30
-
31
- theorem encodingIso_value (x : g.Node) :
32
- (d.encodingIso.toFun x).val = d.encode x := rfl
33
-
34
- theorem decodingIso_encode (x : {x : ZFSet.{u} // x ∈ d.carrier}) :
35
- d.encode (d.decodingIso.toFun x) = x.val := d.encode_decode x
36
-
37
- theorem vertex_cover (z : ZFSet.{u}) (hz : z ∈ d.carrier) :
38
- (∃ p ∈ P, ZFSet.pair p z ∈ attachmentOldEmbeddingGraph P) ∨
39
- ∃ q ∈ Q, ZFSet.pair q z ∈ attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val := by
40
- obtain ⟨x, rfl⟩ := d.encode_surjective z hz
41
- rcases g.cover x with ⟨p, rfl⟩ | ⟨q, rfl⟩
42
- · exact Or.inl ⟨p.val, p.property, (pair_mem_attachmentOldEmbeddingGraph _ _ _).2 ⟨p.property, rfl⟩⟩
43
- · exact Or.inr ⟨q.val, q.property, d.template_entry q⟩
44
-
45
- theorem cross_meet_entry (p : {p : ZFSet.{u} // p ∈ P})
46
- (q : {q : ZFSet.{u} // q ∈ Q}) :
47
- ZFSet.pair (ZFSet.pair p.val (d.encode (g.right.toFun q)))
48
- (old.toMeetOrder.meet p (g.shadow q)).val ∈ d.meetGraph := by
49
- have entry := d.encoded_meet_entry (g.left.toFun p) (g.right.toFun q)
50
- rw [g.cross_meet] at entry
51
- exact entry
52
-
53
- theorem old_graph_ideal {p z : ZFSet.{u}} (hp : p ∈ P) (hz : z ∈ d.carrier)
54
- (lower : ZFSet.pair z p ∈ d.order) :
55
- ∃ x ∈ P, ZFSet.pair x z ∈ attachmentOldEmbeddingGraph P := by
56
- obtain ⟨x, rfl⟩ := d.encode_surjective z hz
57
- obtain ⟨q, rfl⟩ := d.old_ideal ⟨p, hp⟩ x lower
58
- exact ⟨q.val, q.property, (pair_mem_attachmentOldEmbeddingGraph _ _ _).2 ⟨q.property, rfl⟩⟩
59
-
60
- theorem template_graph_ideal {q y z : ZFSet.{u}}
61
- (entry : ZFSet.pair q y ∈ attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val)
62
- (hz : z ∈ d.carrier) (lower : ZFSet.pair z y ∈ d.order) :
63
- ∃ x ∈ Q, ZFSet.pair x z ∈ attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val := by
64
- have hq := (ZFSet.pair_mem_prod.1 ((attachmentTemplateEmbeddingGraph_isFunc d.base_function).1 entry)).1
65
- have eq := (d.template_entry_iff ⟨q, hq⟩ y).1 entry
66
- rw [eq] at lower
67
- obtain ⟨x, rfl⟩ := d.encode_surjective z hz
68
- obtain ⟨p, rfl⟩ := d.template_ideal ⟨q, hq⟩ x lower
69
- exact ⟨p.val, p.property, d.template_entry p⟩
70
-
71
- end PartitionPilot.Forcing.CodedPrincipalTile
72
-
73
- end
74
-
75
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Geometry.SeparationTileCodes
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing.CodedPrincipalTile
8
+ open Compression.RecursiveMaps
9
+ universe u
10
+ variable {P Q rP rQ μP μQ ell : ZFSet.{u}}
11
+ variable {old : MeetOrderCode P rP μP} {right : MeetOrderCode Q rQ μQ}
12
+ variable {g : PrincipalAmalgamation.Input old.toMeetOrder right.toMeetOrder}
13
+ variable (d : CodedPrincipalTile old right g ell)
14
+
15
+ noncomputable def decode (x : {x : ZFSet.{u} // x ∈ d.carrier}) : g.Node :=
16
+ Classical.choose (d.encode_surjective x.val x.property)
17
+
18
+ theorem encode_decode (x : {x : ZFSet.{u} // x ∈ d.carrier}) : d.encode (d.decode x) = x.val :=
19
+ Classical.choose_spec (d.encode_surjective x.val x.property)
20
+
21
+ theorem decode_encode (x : g.Node) : d.decode ⟨d.encode x, d.encode_mem x⟩ = x :=
22
+ d.encode_injective (d.encode_decode _)
23
+
24
+ noncomputable def encodingIso : Compression.MeetIso g.order d.meetOrder.toMeetOrder :=
25
+ isoOfOrder (fun x => ⟨d.encode x, d.encode_mem x⟩) d.decode d.decode_encode
26
+ (fun x => Subtype.ext (d.encode_decode x)) d.le_encode
27
+
28
+ noncomputable def decodingIso : Compression.MeetIso d.meetOrder.toMeetOrder g.order :=
29
+ inverseIso d.encodingIso
30
+
31
+ theorem encodingIso_value (x : g.Node) :
32
+ (d.encodingIso.toFun x).val = d.encode x := rfl
33
+
34
+ theorem decodingIso_encode (x : {x : ZFSet.{u} // x ∈ d.carrier}) :
35
+ d.encode (d.decodingIso.toFun x) = x.val := d.encode_decode x
36
+
37
+ theorem vertex_cover (z : ZFSet.{u}) (hz : z ∈ d.carrier) :
38
+ (∃ p ∈ P, ZFSet.pair p z ∈ attachmentOldEmbeddingGraph P) ∨
39
+ ∃ q ∈ Q, ZFSet.pair q z ∈ attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val := by
40
+ obtain ⟨x, rfl⟩ := d.encode_surjective z hz
41
+ rcases g.cover x with ⟨p, rfl⟩ | ⟨q, rfl⟩
42
+ · exact Or.inl ⟨p.val, p.property, (pair_mem_attachmentOldEmbeddingGraph _ _ _).2 ⟨p.property, rfl⟩⟩
43
+ · exact Or.inr ⟨q.val, q.property, d.template_entry q⟩
44
+
45
+ theorem cross_meet_entry (p : {p : ZFSet.{u} // p ∈ P})
46
+ (q : {q : ZFSet.{u} // q ∈ Q}) :
47
+ ZFSet.pair (ZFSet.pair p.val (d.encode (g.right.toFun q)))
48
+ (old.toMeetOrder.meet p (g.shadow q)).val ∈ d.meetGraph := by
49
+ have entry := d.encoded_meet_entry (g.left.toFun p) (g.right.toFun q)
50
+ rw [g.cross_meet] at entry
51
+ exact entry
52
+
53
+ theorem old_graph_ideal {p z : ZFSet.{u}} (hp : p ∈ P) (hz : z ∈ d.carrier)
54
+ (lower : ZFSet.pair z p ∈ d.order) :
55
+ ∃ x ∈ P, ZFSet.pair x z ∈ attachmentOldEmbeddingGraph P := by
56
+ obtain ⟨x, rfl⟩ := d.encode_surjective z hz
57
+ obtain ⟨q, rfl⟩ := d.old_ideal ⟨p, hp⟩ x lower
58
+ exact ⟨q.val, q.property, (pair_mem_attachmentOldEmbeddingGraph _ _ _).2 ⟨q.property, rfl⟩⟩
59
+
60
+ theorem template_graph_ideal {q y z : ZFSet.{u}}
61
+ (entry : ZFSet.pair q y ∈ attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val)
62
+ (hz : z ∈ d.carrier) (lower : ZFSet.pair z y ∈ d.order) :
63
+ ∃ x ∈ Q, ZFSet.pair x z ∈ attachmentTemplateEmbeddingGraph P Q rQ ell g.rightAnchor.val := by
64
+ have hq := (ZFSet.pair_mem_prod.1 ((attachmentTemplateEmbeddingGraph_isFunc d.base_function).1 entry)).1
65
+ have eq := (d.template_entry_iff ⟨q, hq⟩ y).1 entry
66
+ rw [eq] at lower
67
+ obtain ⟨x, rfl⟩ := d.encode_surjective z hz
68
+ obtain ⟨p, rfl⟩ := d.template_ideal ⟨q, hq⟩ x lower
69
+ exact ⟨p.val, p.property, d.template_entry p⟩
70
+
71
+ end PartitionPilot.Forcing.CodedPrincipalTile
72
+
73
+ end
74
+
75
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/RationalCodeLaws.lean CHANGED
@@ -1,169 +1,169 @@
1
- import OAI.SetTheory.PartitionPrinciple.Forcing.CodedDenseOrders
2
-
3
- namespace OAI
4
-
5
-
6
- namespace PartitionPilot.Forcing
7
-
8
- open SetRealization Compression.RecursiveMaps.RationalHeights
9
- universe u
10
-
11
- theorem fractionEquivalence_code : EquivalenceRelationCode fractionCarrier.{u} fractionEquivGraph := by
12
- refine ⟨fractionEquivGraph_subset, ?_, ?_, ?_⟩
13
- · intro x hx
14
- obtain ⟨a, rfl⟩ := (mem_fractionCarrier x).1 hx
15
- exact (pair_mem_fractionEquivGraph a a).2 rfl
16
- · intro x y hxy
17
- have shape := ZFSet.pair_mem_prod.1 (fractionEquivGraph_subset hxy)
18
- obtain ⟨a, rfl⟩ := (mem_fractionCarrier x).1 shape.1
19
- obtain ⟨b, rfl⟩ := (mem_fractionCarrier y).1 shape.2
20
- exact (pair_mem_fractionEquivGraph b a).2 ((pair_mem_fractionEquivGraph a b).1 hxy).symm
21
- · intro x y z hxy hyz
22
- have shape := ZFSet.pair_mem_prod.1 (fractionEquivGraph_subset hxy)
23
- have zmem := (ZFSet.pair_mem_prod.1 (fractionEquivGraph_subset hyz)).2
24
- obtain ⟨a, rfl⟩ := (mem_fractionCarrier x).1 shape.1
25
- obtain ⟨b, rfl⟩ := (mem_fractionCarrier y).1 shape.2
26
- obtain ⟨d, rfl⟩ := (mem_fractionCarrier z).1 zmem
27
- exact (pair_mem_fractionEquivGraph a d).2 (Fraction.equiv_trans
28
- ((pair_mem_fractionEquivGraph a b).1 hxy) ((pair_mem_fractionEquivGraph b d).1 hyz))
29
-
30
- noncomputable def rationalCarrier (c : ZFSet.{u}) : ZFSet.{u} :=
31
- canonicalRepresentatives fractionCarrier fractionEquivGraph c
32
-
33
- theorem rationalCarrier_subset (c : ZFSet.{u}) : rationalCarrier c ⊆ fractionCarrier :=
34
- canonicalRepresentatives_subset _ _ _
35
-
36
- noncomputable def rationalEncode {c : ZFSet.{u}}
37
- (hc : InjectionCode fractionCarrier ZFSet.omega c) (r : Rational) : ZFSet.{u} :=
38
- Classical.choose (canonical_exists_unique fractionEquivalence_code hc
39
- (fractionEncode_mem (Rational.representative r)))
40
-
41
- theorem rationalEncode_spec {c : ZFSet.{u}}
42
- (hc : InjectionCode fractionCarrier ZFSet.omega c) (r : Rational) :
43
- rationalEncode hc r ∈ rationalCarrier c ∧
44
- ZFSet.pair (fractionEncode (Rational.representative r)) (rationalEncode hc r) ∈ fractionEquivGraph :=
45
- (Classical.choose_spec (canonical_exists_unique fractionEquivalence_code hc
46
- (fractionEncode_mem (Rational.representative r)))).1
47
-
48
- theorem rationalEncode_class {c : ZFSet.{u}}
49
- (hc : InjectionCode fractionCarrier ZFSet.omega c) (r : Rational) :
50
- ∃ a : Fraction, fractionEncode a = rationalEncode hc r ∧ Rational.mk a = r := by
51
- have spec := rationalEncode_spec hc r
52
- obtain ⟨a, ha⟩ := (mem_fractionCarrier _).1 (rationalCarrier_subset c spec.1)
53
- refine ⟨a, ha, ?_⟩
54
- rw [← ha] at spec
55
- have eq := (Rational.mk_eq_iff _ _).2 ((pair_mem_fractionEquivGraph _ _).1 spec.2)
56
- exact eq.symm.trans (Rational.representative_eq r)
57
-
58
- theorem rationalEncode_injective {c : ZFSet.{u}}
59
- (hc : InjectionCode fractionCarrier ZFSet.omega c) : Function.Injective (rationalEncode hc) := by
60
- intro r s eq
61
- obtain ⟨a, ha, ar⟩ := rationalEncode_class hc r
62
- obtain ⟨b, hb, bs⟩ := rationalEncode_class hc s
63
- have ab := fractionEncode_injective (ha.trans (eq.trans hb.symm))
64
- exact ar.symm.trans ((congrArg Rational.mk ab).trans bs)
65
-
66
- theorem rationalEncode_of_canonical {c : ZFSet.{u}}
67
- (hc : InjectionCode fractionCarrier ZFSet.omega c) (a : Fraction)
68
- (ha : fractionEncode a ∈ rationalCarrier c) :
69
- rationalEncode hc (Rational.mk a) = fractionEncode a := by
70
- have unique := (Classical.choose_spec (canonical_exists_unique fractionEquivalence_code hc
71
- (fractionEncode_mem (Rational.representative (Rational.mk a))))).2
72
- exact (unique (fractionEncode a) ⟨ha,
73
- (pair_mem_fractionEquivGraph _ _).2 (Rational.representative_equiv a)⟩).symm
74
-
75
- noncomputable def rationalPresentation {c : ZFSet.{u}}
76
- (hc : InjectionCode fractionCarrier ZFSet.omega c) : Presentation (ULift.{u} Rational) where
77
- carrier := rationalCarrier c
78
- encode r := rationalEncode hc r.down
79
- injective := fun _ _ eq => ULift.ext _ _ (rationalEncode_injective hc eq)
80
- mem_carrier x := by
81
- constructor
82
- · intro hx
83
- obtain ⟨a, rfl⟩ := (mem_fractionCarrier _).1 (rationalCarrier_subset c hx)
84
- exact ⟨⟨Rational.mk a⟩, rationalEncode_of_canonical hc a hx⟩
85
- · rintro ⟨r, rfl⟩
86
- exact (rationalEncode_spec hc r.down).1
87
-
88
- noncomputable def rationalLtGraph (c : ZFSet.{u}) : ZFSet.{u} :=
89
- ZFSet.sep (fun z => z ∈ ZFSet.prod (rationalCarrier c) (rationalCarrier c)) fractionLtGraph
90
-
91
- theorem rationalLtGraph_subset (c : ZFSet.{u}) :
92
- rationalLtGraph c ⊆ ZFSet.prod (rationalCarrier c) (rationalCarrier c) :=
93
- fun _ h => (ZFSet.mem_sep.1 h).2
94
-
95
- theorem pair_mem_rationalLtGraph {c : ZFSet.{u}}
96
- (hc : InjectionCode fractionCarrier ZFSet.omega c) (r s : Rational) :
97
- ZFSet.pair (rationalEncode hc r) (rationalEncode hc s) ∈ rationalLtGraph c ↔ Rational.lt r s := by
98
- have first := (rationalEncode_spec hc r).1
99
- have second := (rationalEncode_spec hc s).1
100
- rw [rationalLtGraph, ZFSet.mem_sep]
101
- have lookup : ZFSet.pair (rationalEncode hc r) (rationalEncode hc s) ∈ fractionLtGraph ↔
102
- Rational.lt r s := by
103
- obtain ⟨a, ha, ar⟩ := rationalEncode_class hc r
104
- obtain ⟨b, hb, bs⟩ := rationalEncode_class hc s
105
- rw [← ha, ← hb, pair_mem_fractionLtGraph, ← ar, ← bs]
106
- exact Iff.rfl
107
- exact ⟨fun h => lookup.1 h.1,
108
- fun h => ⟨lookup.2 h, ZFSet.pair_mem_prod.2 ⟨first, second⟩⟩⟩
109
-
110
- end PartitionPilot.Forcing
111
-
112
-
113
-
114
- namespace PartitionPilot.Forcing
115
-
116
- open Compression.RecursiveMaps.RationalHeights
117
- universe u
118
-
119
- theorem rational_denseOrderCode {c : ZFSet.{u}}
120
- (hc : InjectionCode fractionCarrier ZFSet.omega c) :
121
- DenseOrderCode (rationalCarrier c) (rationalLtGraph c) := by
122
- refine ⟨⟨rationalLtGraph_subset c, ?_, ?_, ?_⟩, ?_⟩
123
- · intro x hx
124
- obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 hx
125
- exact fun h => Rational.irrefl a.down ((pair_mem_rationalLtGraph hc _ _).1 h)
126
- · intro x y z xy yz
127
- have shape := ZFSet.pair_mem_prod.1 (rationalLtGraph_subset c xy)
128
- have hz := (ZFSet.pair_mem_prod.1 (rationalLtGraph_subset c yz)).2
129
- obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 shape.1
130
- obtain ⟨b, rfl⟩ := ((rationalPresentation hc).mem_carrier y).1 shape.2
131
- obtain ⟨d, rfl⟩ := ((rationalPresentation hc).mem_carrier z).1 hz
132
- exact (pair_mem_rationalLtGraph hc _ _).2 (Rational.trans
133
- ((pair_mem_rationalLtGraph hc _ _).1 xy) ((pair_mem_rationalLtGraph hc _ _).1 yz))
134
- · intro x hx y hy
135
- obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 hx
136
- obtain ⟨b, rfl⟩ := ((rationalPresentation hc).mem_carrier y).1 hy
137
- rcases Rational.compare a.down b.down with less | same | more
138
- · exact Or.inl ((pair_mem_rationalLtGraph hc _ _).2 less)
139
- · exact Or.inr (Or.inl (congrArg (rationalEncode hc) same))
140
- · exact Or.inr (Or.inr ((pair_mem_rationalLtGraph hc _ _).2 more))
141
- · intro x y xy
142
- have shape := ZFSet.pair_mem_prod.1 (rationalLtGraph_subset c xy)
143
- obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 shape.1
144
- obtain ⟨b, rfl⟩ := ((rationalPresentation hc).mem_carrier y).1 shape.2
145
- obtain ⟨d, ad, db⟩ := Rational.between _ _ ((pair_mem_rationalLtGraph hc _ _).1 xy)
146
- exact ⟨rationalEncode hc d, (rationalEncode_spec hc d).1,
147
- (pair_mem_rationalLtGraph hc _ _).2 ad, (pair_mem_rationalLtGraph hc _ _).2 db⟩
148
-
149
- theorem rationalCarrier_nonempty {c : ZFSet.{u}}
150
- (hc : InjectionCode fractionCarrier ZFSet.omega c) : ∃ x, x ∈ rationalCarrier c :=
151
- ⟨rationalEncode hc (Rational.mk ⟨0, 1, by decide⟩), (rationalEncode_spec hc _).1⟩
152
-
153
- theorem rational_no_endpoints {c : ZFSet.{u}}
154
- (hc : InjectionCode fractionCarrier ZFSet.omega c) :
155
- ∀ x ∈ rationalCarrier c,
156
- (∃ y ∈ rationalCarrier c, ZFSet.pair y x ∈ rationalLtGraph c) ∧
157
- (∃ y ∈ rationalCarrier c, ZFSet.pair x y ∈ rationalLtGraph c) := by
158
- intro x hx
159
- obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 hx
160
- obtain ⟨b, ba⟩ := Rational.unbounded_below a.down
161
- obtain ⟨d, ad⟩ := Rational.unbounded_above a.down
162
- exact ⟨⟨rationalEncode hc b, (rationalEncode_spec hc b).1,
163
- (pair_mem_rationalLtGraph hc _ _).2 ba⟩,
164
- ⟨rationalEncode hc d, (rationalEncode_spec hc d).1,
165
- (pair_mem_rationalLtGraph hc _ _).2 ad⟩⟩
166
-
167
- end PartitionPilot.Forcing
168
-
169
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Forcing.CodedDenseOrders
2
+
3
+ namespace OAI
4
+
5
+
6
+ namespace PartitionPilot.Forcing
7
+
8
+ open SetRealization Compression.RecursiveMaps.RationalHeights
9
+ universe u
10
+
11
+ theorem fractionEquivalence_code : EquivalenceRelationCode fractionCarrier.{u} fractionEquivGraph := by
12
+ refine ⟨fractionEquivGraph_subset, ?_, ?_, ?_⟩
13
+ · intro x hx
14
+ obtain ⟨a, rfl⟩ := (mem_fractionCarrier x).1 hx
15
+ exact (pair_mem_fractionEquivGraph a a).2 rfl
16
+ · intro x y hxy
17
+ have shape := ZFSet.pair_mem_prod.1 (fractionEquivGraph_subset hxy)
18
+ obtain ⟨a, rfl⟩ := (mem_fractionCarrier x).1 shape.1
19
+ obtain ⟨b, rfl⟩ := (mem_fractionCarrier y).1 shape.2
20
+ exact (pair_mem_fractionEquivGraph b a).2 ((pair_mem_fractionEquivGraph a b).1 hxy).symm
21
+ · intro x y z hxy hyz
22
+ have shape := ZFSet.pair_mem_prod.1 (fractionEquivGraph_subset hxy)
23
+ have zmem := (ZFSet.pair_mem_prod.1 (fractionEquivGraph_subset hyz)).2
24
+ obtain ⟨a, rfl⟩ := (mem_fractionCarrier x).1 shape.1
25
+ obtain ⟨b, rfl⟩ := (mem_fractionCarrier y).1 shape.2
26
+ obtain ⟨d, rfl⟩ := (mem_fractionCarrier z).1 zmem
27
+ exact (pair_mem_fractionEquivGraph a d).2 (Fraction.equiv_trans
28
+ ((pair_mem_fractionEquivGraph a b).1 hxy) ((pair_mem_fractionEquivGraph b d).1 hyz))
29
+
30
+ noncomputable def rationalCarrier (c : ZFSet.{u}) : ZFSet.{u} :=
31
+ canonicalRepresentatives fractionCarrier fractionEquivGraph c
32
+
33
+ theorem rationalCarrier_subset (c : ZFSet.{u}) : rationalCarrier c ⊆ fractionCarrier :=
34
+ canonicalRepresentatives_subset _ _ _
35
+
36
+ noncomputable def rationalEncode {c : ZFSet.{u}}
37
+ (hc : InjectionCode fractionCarrier ZFSet.omega c) (r : Rational) : ZFSet.{u} :=
38
+ Classical.choose (canonical_exists_unique fractionEquivalence_code hc
39
+ (fractionEncode_mem (Rational.representative r)))
40
+
41
+ theorem rationalEncode_spec {c : ZFSet.{u}}
42
+ (hc : InjectionCode fractionCarrier ZFSet.omega c) (r : Rational) :
43
+ rationalEncode hc r ∈ rationalCarrier c ∧
44
+ ZFSet.pair (fractionEncode (Rational.representative r)) (rationalEncode hc r) ∈ fractionEquivGraph :=
45
+ (Classical.choose_spec (canonical_exists_unique fractionEquivalence_code hc
46
+ (fractionEncode_mem (Rational.representative r)))).1
47
+
48
+ theorem rationalEncode_class {c : ZFSet.{u}}
49
+ (hc : InjectionCode fractionCarrier ZFSet.omega c) (r : Rational) :
50
+ ∃ a : Fraction, fractionEncode a = rationalEncode hc r ∧ Rational.mk a = r := by
51
+ have spec := rationalEncode_spec hc r
52
+ obtain ⟨a, ha⟩ := (mem_fractionCarrier _).1 (rationalCarrier_subset c spec.1)
53
+ refine ⟨a, ha, ?_⟩
54
+ rw [← ha] at spec
55
+ have eq := (Rational.mk_eq_iff _ _).2 ((pair_mem_fractionEquivGraph _ _).1 spec.2)
56
+ exact eq.symm.trans (Rational.representative_eq r)
57
+
58
+ theorem rationalEncode_injective {c : ZFSet.{u}}
59
+ (hc : InjectionCode fractionCarrier ZFSet.omega c) : Function.Injective (rationalEncode hc) := by
60
+ intro r s eq
61
+ obtain ⟨a, ha, ar⟩ := rationalEncode_class hc r
62
+ obtain ⟨b, hb, bs⟩ := rationalEncode_class hc s
63
+ have ab := fractionEncode_injective (ha.trans (eq.trans hb.symm))
64
+ exact ar.symm.trans ((congrArg Rational.mk ab).trans bs)
65
+
66
+ theorem rationalEncode_of_canonical {c : ZFSet.{u}}
67
+ (hc : InjectionCode fractionCarrier ZFSet.omega c) (a : Fraction)
68
+ (ha : fractionEncode a ∈ rationalCarrier c) :
69
+ rationalEncode hc (Rational.mk a) = fractionEncode a := by
70
+ have unique := (Classical.choose_spec (canonical_exists_unique fractionEquivalence_code hc
71
+ (fractionEncode_mem (Rational.representative (Rational.mk a))))).2
72
+ exact (unique (fractionEncode a) ⟨ha,
73
+ (pair_mem_fractionEquivGraph _ _).2 (Rational.representative_equiv a)⟩).symm
74
+
75
+ noncomputable def rationalPresentation {c : ZFSet.{u}}
76
+ (hc : InjectionCode fractionCarrier ZFSet.omega c) : Presentation (ULift.{u} Rational) where
77
+ carrier := rationalCarrier c
78
+ encode r := rationalEncode hc r.down
79
+ injective := fun _ _ eq => ULift.ext _ _ (rationalEncode_injective hc eq)
80
+ mem_carrier x := by
81
+ constructor
82
+ · intro hx
83
+ obtain ⟨a, rfl⟩ := (mem_fractionCarrier _).1 (rationalCarrier_subset c hx)
84
+ exact ⟨⟨Rational.mk a⟩, rationalEncode_of_canonical hc a hx⟩
85
+ · rintro ⟨r, rfl⟩
86
+ exact (rationalEncode_spec hc r.down).1
87
+
88
+ noncomputable def rationalLtGraph (c : ZFSet.{u}) : ZFSet.{u} :=
89
+ ZFSet.sep (fun z => z ∈ ZFSet.prod (rationalCarrier c) (rationalCarrier c)) fractionLtGraph
90
+
91
+ theorem rationalLtGraph_subset (c : ZFSet.{u}) :
92
+ rationalLtGraph c ⊆ ZFSet.prod (rationalCarrier c) (rationalCarrier c) :=
93
+ fun _ h => (ZFSet.mem_sep.1 h).2
94
+
95
+ theorem pair_mem_rationalLtGraph {c : ZFSet.{u}}
96
+ (hc : InjectionCode fractionCarrier ZFSet.omega c) (r s : Rational) :
97
+ ZFSet.pair (rationalEncode hc r) (rationalEncode hc s) ∈ rationalLtGraph c ↔ Rational.lt r s := by
98
+ have first := (rationalEncode_spec hc r).1
99
+ have second := (rationalEncode_spec hc s).1
100
+ rw [rationalLtGraph, ZFSet.mem_sep]
101
+ have lookup : ZFSet.pair (rationalEncode hc r) (rationalEncode hc s) ∈ fractionLtGraph ↔
102
+ Rational.lt r s := by
103
+ obtain ⟨a, ha, ar⟩ := rationalEncode_class hc r
104
+ obtain ⟨b, hb, bs⟩ := rationalEncode_class hc s
105
+ rw [← ha, ← hb, pair_mem_fractionLtGraph, ← ar, ← bs]
106
+ exact Iff.rfl
107
+ exact ⟨fun h => lookup.1 h.1,
108
+ fun h => ⟨lookup.2 h, ZFSet.pair_mem_prod.2 ⟨first, second⟩⟩⟩
109
+
110
+ end PartitionPilot.Forcing
111
+
112
+
113
+
114
+ namespace PartitionPilot.Forcing
115
+
116
+ open Compression.RecursiveMaps.RationalHeights
117
+ universe u
118
+
119
+ theorem rational_denseOrderCode {c : ZFSet.{u}}
120
+ (hc : InjectionCode fractionCarrier ZFSet.omega c) :
121
+ DenseOrderCode (rationalCarrier c) (rationalLtGraph c) := by
122
+ refine ⟨⟨rationalLtGraph_subset c, ?_, ?_, ?_⟩, ?_⟩
123
+ · intro x hx
124
+ obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 hx
125
+ exact fun h => Rational.irrefl a.down ((pair_mem_rationalLtGraph hc _ _).1 h)
126
+ · intro x y z xy yz
127
+ have shape := ZFSet.pair_mem_prod.1 (rationalLtGraph_subset c xy)
128
+ have hz := (ZFSet.pair_mem_prod.1 (rationalLtGraph_subset c yz)).2
129
+ obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 shape.1
130
+ obtain ⟨b, rfl⟩ := ((rationalPresentation hc).mem_carrier y).1 shape.2
131
+ obtain ⟨d, rfl⟩ := ((rationalPresentation hc).mem_carrier z).1 hz
132
+ exact (pair_mem_rationalLtGraph hc _ _).2 (Rational.trans
133
+ ((pair_mem_rationalLtGraph hc _ _).1 xy) ((pair_mem_rationalLtGraph hc _ _).1 yz))
134
+ · intro x hx y hy
135
+ obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 hx
136
+ obtain ⟨b, rfl⟩ := ((rationalPresentation hc).mem_carrier y).1 hy
137
+ rcases Rational.compare a.down b.down with less | same | more
138
+ · exact Or.inl ((pair_mem_rationalLtGraph hc _ _).2 less)
139
+ · exact Or.inr (Or.inl (congrArg (rationalEncode hc) same))
140
+ · exact Or.inr (Or.inr ((pair_mem_rationalLtGraph hc _ _).2 more))
141
+ · intro x y xy
142
+ have shape := ZFSet.pair_mem_prod.1 (rationalLtGraph_subset c xy)
143
+ obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 shape.1
144
+ obtain ⟨b, rfl⟩ := ((rationalPresentation hc).mem_carrier y).1 shape.2
145
+ obtain ⟨d, ad, db⟩ := Rational.between _ _ ((pair_mem_rationalLtGraph hc _ _).1 xy)
146
+ exact ⟨rationalEncode hc d, (rationalEncode_spec hc d).1,
147
+ (pair_mem_rationalLtGraph hc _ _).2 ad, (pair_mem_rationalLtGraph hc _ _).2 db⟩
148
+
149
+ theorem rationalCarrier_nonempty {c : ZFSet.{u}}
150
+ (hc : InjectionCode fractionCarrier ZFSet.omega c) : ∃ x, x ∈ rationalCarrier c :=
151
+ ⟨rationalEncode hc (Rational.mk ⟨0, 1, by decide⟩), (rationalEncode_spec hc _).1⟩
152
+
153
+ theorem rational_no_endpoints {c : ZFSet.{u}}
154
+ (hc : InjectionCode fractionCarrier ZFSet.omega c) :
155
+ ∀ x ∈ rationalCarrier c,
156
+ (∃ y ∈ rationalCarrier c, ZFSet.pair y x ∈ rationalLtGraph c) ∧
157
+ (∃ y ∈ rationalCarrier c, ZFSet.pair x y ∈ rationalLtGraph c) := by
158
+ intro x hx
159
+ obtain ⟨a, rfl⟩ := ((rationalPresentation hc).mem_carrier x).1 hx
160
+ obtain ⟨b, ba⟩ := Rational.unbounded_below a.down
161
+ obtain ⟨d, ad⟩ := Rational.unbounded_above a.down
162
+ exact ⟨⟨rationalEncode hc b, (rationalEncode_spec hc b).1,
163
+ (pair_mem_rationalLtGraph hc _ _).2 ba⟩,
164
+ ⟨rationalEncode hc d, (rationalEncode_spec hc d).1,
165
+ (pair_mem_rationalLtGraph hc _ _).2 ad⟩⟩
166
+
167
+ end PartitionPilot.Forcing
168
+
169
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/RawCheckFormulas.lean CHANGED
@@ -1,123 +1,123 @@
1
- import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSymmetricPowerSet
2
-
3
- namespace OAI
4
-
5
-
6
- namespace PartitionPilot.Forcing.Name
7
-
8
- open SetRealization
9
- universe u
10
- variable {P : Type u} (s : Presentation P)
11
-
12
- theorem mem_check_code (one : P) (x z : ZFSet.{u}) :
13
- z ∈ (check s one x).val ↔ ∃ y ∈ x, z = ZFSet.pair (check s one y).val (s.encode one) := by
14
- rw [check]
15
- change z ∈ ZFSet.range _ ↔ _
16
- rw [ZFSet.mem_range]
17
- constructor
18
- · rintro ⟨y, eq⟩
19
- exact ⟨y.val, y.property, eq.symm⟩
20
- · rintro ⟨y, hy, eq⟩
21
- exact ⟨⟨y, hy⟩, eq.symm⟩
22
-
23
- end PartitionPilot.Forcing.Name
24
-
25
- namespace PartitionPilot.Forcing.SetFormula
26
-
27
- def checkStepFormula {n : Nat} (top r x y : Fin n) : SetFormula n :=
28
- .conj
29
- (.all (imp (.mem 0 x.succ) (ex (.conj (pairMembershipFormula 1 0 r.succ.succ)
30
- (pairMembershipFormula 0 top.succ.succ y.succ.succ)))))
31
- (.all (imp (.mem 0 y.succ) (ex (ex (.conj (.mem 1 x.succ.succ.succ)
32
- (.conj (pairMembershipFormula 1 0 r.succ.succ.succ)
33
- (orderedPairFormula 2 0 top.succ.succ.succ)))))))
34
-
35
- end PartitionPilot.Forcing.SetFormula
36
-
37
- namespace PartitionPilot.Forcing.TransitiveGround
38
-
39
- open SetRealization SetFormula
40
- universe u
41
- variable (M : TransitiveGround.{u})
42
-
43
- def RawCheckStep (top R x y : ZFSet.{u}) : Prop :=
44
- (∀ v ∈ x, ∃ w ∈ M.sets, ZFSet.pair v w ∈ R ∧ ZFSet.pair w top ∈ y) ∧
45
- (∀ z ∈ y, ∃ v ∈ x, ∃ w ∈ M.sets, ZFSet.pair v w ∈ R ∧ z = ZFSet.pair w top)
46
-
47
- theorem rawCheckStep_mono {top R S x y : ZFSet.{u}} (sub : R ⊆ S)
48
- (h : M.RawCheckStep top R x y) : M.RawCheckStep top S x y := by
49
- constructor
50
- · intro v hv
51
- obtain ⟨w, hw, rel, entry⟩ := h.1 v hv
52
- exact ⟨w, hw, sub rel, entry⟩
53
- · intro z hz
54
- obtain ⟨v, hv, w, hw, rel, eq⟩ := h.2 z hz
55
- exact ⟨v, hv, w, hw, sub rel, eq⟩
56
-
57
- theorem realize_checkStepFormula
58
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
59
- {n : Nat} (top r x y : Fin n) (env : Fin n → ZFSet.{u})
60
- (htop : env top ∈ M.sets) (hr : env r ∈ M.sets)
61
- (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) :
62
- Realize M.sets (checkStepFormula top r x y) env ↔
63
- M.RawCheckStep (env top) (env r) (env x) (env y) := by
64
- change (Realize M.sets _ env ∧ Realize M.sets _ env) ↔ _
65
- constructor
66
- · rintro ⟨forward, backward⟩
67
- constructor
68
- · intro v hv
69
- have step := (realize_imp M.sets _ _ _).1 (forward v (M.transitive hx hv)) hv
70
- obtain ⟨w, hw, rel, entry⟩ := (realize_ex M.sets _ _).1 step
71
- let e := extend w (extend v env)
72
- exact ⟨w, hw,
73
- (M.realize_pairMembershipFormula pairing 1 0 r.succ.succ e (M.transitive hx hv) hw hr).1 rel,
74
- (M.realize_pairMembershipFormula pairing 0 top.succ.succ y.succ.succ e hw htop hy).1 entry⟩
75
- · intro z hz
76
- have step := (realize_imp M.sets _ _ _).1 (backward z (M.transitive hy hz)) hz
77
- obtain ⟨v, hv, step⟩ := (realize_ex M.sets _ _).1 step
78
- obtain ⟨w, hw, member, rel, shape⟩ := (realize_ex M.sets _ _).1 step
79
- let e := extend w (extend v (extend z env))
80
- exact ⟨v, member, w, hw,
81
- (M.realize_pairMembershipFormula pairing 1 0 r.succ.succ.succ e hv hw hr).1 rel,
82
- (M.realize_orderedPairFormula pairing 2 0 top.succ.succ.succ e (M.transitive hy hz) hw htop).1 shape⟩
83
- · rintro ⟨forward, backward⟩
84
- constructor
85
- · intro v hv
86
- rw [realize_imp]
87
- intro member
88
- obtain ⟨w, hw, rel, entry⟩ := forward v member
89
- rw [realize_ex]
90
- let e := extend w (extend v env)
91
- exact ⟨w, hw,
92
- (M.realize_pairMembershipFormula pairing 1 0 r.succ.succ e hv hw hr).2 rel,
93
- (M.realize_pairMembershipFormula pairing 0 top.succ.succ y.succ.succ e hw htop hy).2 entry⟩
94
- · intro z hz
95
- rw [realize_imp]
96
- intro member
97
- obtain ⟨v, hv, w, hw, rel, shape⟩ := backward z member
98
- rw [realize_ex]
99
- refine ⟨v, M.transitive hx hv, ?_⟩
100
- rw [realize_ex]
101
- let e := extend w (extend v (extend z env))
102
- exact ⟨w, hw, hv,
103
- (M.realize_pairMembershipFormula pairing 1 0 r.succ.succ.succ e (M.transitive hx hv) hw hr).2 rel,
104
- (M.realize_orderedPairFormula pairing 2 0 top.succ.succ.succ e hz hw htop).2 shape⟩
105
-
106
- theorem rawCheckStep_eq {P : Type u} (s : Presentation P) (one : P) {R x y : ZFSet.{u}}
107
- (step : M.RawCheckStep (s.encode one) R x y)
108
- (children : ∀ v ∈ x, ∀ w ∈ M.sets, ZFSet.pair v w ∈ R → w = (Name.check s one v).val) :
109
- y = (Name.check s one x).val := by
110
- apply ZFSet.ext
111
- intro z
112
- rw [Name.mem_check_code]
113
- constructor
114
- · intro hz
115
- obtain ⟨v, hv, w, hw, rel, eq⟩ := step.2 z hz
116
- exact ⟨v, hv, eq.trans (congrArg (fun q => ZFSet.pair q (s.encode one)) (children v hv w hw rel))⟩
117
- · rintro ⟨v, hv, rfl⟩
118
- obtain ⟨w, hw, rel, entry⟩ := step.1 v hv
119
- rwa [children v hv w hw rel] at entry
120
-
121
- end PartitionPilot.Forcing.TransitiveGround
122
-
123
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Forcing.GroundSymmetricPowerSet
2
+
3
+ namespace OAI
4
+
5
+
6
+ namespace PartitionPilot.Forcing.Name
7
+
8
+ open SetRealization
9
+ universe u
10
+ variable {P : Type u} (s : Presentation P)
11
+
12
+ theorem mem_check_code (one : P) (x z : ZFSet.{u}) :
13
+ z ∈ (check s one x).val ↔ ∃ y ∈ x, z = ZFSet.pair (check s one y).val (s.encode one) := by
14
+ rw [check]
15
+ change z ∈ ZFSet.range _ ↔ _
16
+ rw [ZFSet.mem_range]
17
+ constructor
18
+ · rintro ⟨y, eq⟩
19
+ exact ⟨y.val, y.property, eq.symm⟩
20
+ · rintro ⟨y, hy, eq⟩
21
+ exact ⟨⟨y, hy⟩, eq.symm⟩
22
+
23
+ end PartitionPilot.Forcing.Name
24
+
25
+ namespace PartitionPilot.Forcing.SetFormula
26
+
27
+ def checkStepFormula {n : Nat} (top r x y : Fin n) : SetFormula n :=
28
+ .conj
29
+ (.all (imp (.mem 0 x.succ) (ex (.conj (pairMembershipFormula 1 0 r.succ.succ)
30
+ (pairMembershipFormula 0 top.succ.succ y.succ.succ)))))
31
+ (.all (imp (.mem 0 y.succ) (ex (ex (.conj (.mem 1 x.succ.succ.succ)
32
+ (.conj (pairMembershipFormula 1 0 r.succ.succ.succ)
33
+ (orderedPairFormula 2 0 top.succ.succ.succ)))))))
34
+
35
+ end PartitionPilot.Forcing.SetFormula
36
+
37
+ namespace PartitionPilot.Forcing.TransitiveGround
38
+
39
+ open SetRealization SetFormula
40
+ universe u
41
+ variable (M : TransitiveGround.{u})
42
+
43
+ def RawCheckStep (top R x y : ZFSet.{u}) : Prop :=
44
+ (∀ v ∈ x, ∃ w ∈ M.sets, ZFSet.pair v w ∈ R ∧ ZFSet.pair w top ∈ y) ∧
45
+ (∀ z ∈ y, ∃ v ∈ x, ∃ w ∈ M.sets, ZFSet.pair v w ∈ R ∧ z = ZFSet.pair w top)
46
+
47
+ theorem rawCheckStep_mono {top R S x y : ZFSet.{u}} (sub : R ⊆ S)
48
+ (h : M.RawCheckStep top R x y) : M.RawCheckStep top S x y := by
49
+ constructor
50
+ · intro v hv
51
+ obtain ⟨w, hw, rel, entry⟩ := h.1 v hv
52
+ exact ⟨w, hw, sub rel, entry⟩
53
+ · intro z hz
54
+ obtain ⟨v, hv, w, hw, rel, eq⟩ := h.2 z hz
55
+ exact ⟨v, hv, w, hw, sub rel, eq⟩
56
+
57
+ theorem realize_checkStepFormula
58
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
59
+ {n : Nat} (top r x y : Fin n) (env : Fin n → ZFSet.{u})
60
+ (htop : env top ∈ M.sets) (hr : env r ∈ M.sets)
61
+ (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) :
62
+ Realize M.sets (checkStepFormula top r x y) env ↔
63
+ M.RawCheckStep (env top) (env r) (env x) (env y) := by
64
+ change (Realize M.sets _ env ∧ Realize M.sets _ env) ↔ _
65
+ constructor
66
+ · rintro ⟨forward, backward⟩
67
+ constructor
68
+ · intro v hv
69
+ have step := (realize_imp M.sets _ _ _).1 (forward v (M.transitive hx hv)) hv
70
+ obtain ⟨w, hw, rel, entry⟩ := (realize_ex M.sets _ _).1 step
71
+ let e := extend w (extend v env)
72
+ exact ⟨w, hw,
73
+ (M.realize_pairMembershipFormula pairing 1 0 r.succ.succ e (M.transitive hx hv) hw hr).1 rel,
74
+ (M.realize_pairMembershipFormula pairing 0 top.succ.succ y.succ.succ e hw htop hy).1 entry⟩
75
+ · intro z hz
76
+ have step := (realize_imp M.sets _ _ _).1 (backward z (M.transitive hy hz)) hz
77
+ obtain ⟨v, hv, step⟩ := (realize_ex M.sets _ _).1 step
78
+ obtain ⟨w, hw, member, rel, shape⟩ := (realize_ex M.sets _ _).1 step
79
+ let e := extend w (extend v (extend z env))
80
+ exact ⟨v, member, w, hw,
81
+ (M.realize_pairMembershipFormula pairing 1 0 r.succ.succ.succ e hv hw hr).1 rel,
82
+ (M.realize_orderedPairFormula pairing 2 0 top.succ.succ.succ e (M.transitive hy hz) hw htop).1 shape⟩
83
+ · rintro ⟨forward, backward⟩
84
+ constructor
85
+ · intro v hv
86
+ rw [realize_imp]
87
+ intro member
88
+ obtain ⟨w, hw, rel, entry⟩ := forward v member
89
+ rw [realize_ex]
90
+ let e := extend w (extend v env)
91
+ exact ⟨w, hw,
92
+ (M.realize_pairMembershipFormula pairing 1 0 r.succ.succ e hv hw hr).2 rel,
93
+ (M.realize_pairMembershipFormula pairing 0 top.succ.succ y.succ.succ e hw htop hy).2 entry⟩
94
+ · intro z hz
95
+ rw [realize_imp]
96
+ intro member
97
+ obtain ⟨v, hv, w, hw, rel, shape⟩ := backward z member
98
+ rw [realize_ex]
99
+ refine ⟨v, M.transitive hx hv, ?_⟩
100
+ rw [realize_ex]
101
+ let e := extend w (extend v (extend z env))
102
+ exact ⟨w, hw, hv,
103
+ (M.realize_pairMembershipFormula pairing 1 0 r.succ.succ.succ e (M.transitive hx hv) hw hr).2 rel,
104
+ (M.realize_orderedPairFormula pairing 2 0 top.succ.succ.succ e hz hw htop).2 shape⟩
105
+
106
+ theorem rawCheckStep_eq {P : Type u} (s : Presentation P) (one : P) {R x y : ZFSet.{u}}
107
+ (step : M.RawCheckStep (s.encode one) R x y)
108
+ (children : ∀ v ∈ x, ∀ w ∈ M.sets, ZFSet.pair v w ∈ R → w = (Name.check s one v).val) :
109
+ y = (Name.check s one x).val := by
110
+ apply ZFSet.ext
111
+ intro z
112
+ rw [Name.mem_check_code]
113
+ constructor
114
+ · intro hz
115
+ obtain ⟨v, hv, w, hw, rel, eq⟩ := step.2 z hz
116
+ exact ⟨v, hv, eq.trans (congrArg (fun q => ZFSet.pair q (s.encode one)) (children v hv w hw rel))⟩
117
+ · rintro ⟨v, hv, rfl⟩
118
+ obtain ⟨w, hw, rel, entry⟩ := step.1 v hv
119
+ rwa [children v hv w hw rel] at entry
120
+
121
+ end PartitionPilot.Forcing.TransitiveGround
122
+
123
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/RawRenameFormulas.lean CHANGED
@@ -1,141 +1,141 @@
1
- import OAI.SetTheory.PartitionPrinciple.Forcing.NameRenameSteps
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing.SetFormula
8
-
9
- def orientedPairFormula {n : Nat} (reverse : Bool) (x y r : Fin n) : SetFormula n :=
10
- if reverse then pairMembershipFormula y x r else pairMembershipFormula x y r
11
-
12
- end PartitionPilot.Forcing.SetFormula
13
-
14
- namespace PartitionPilot.Forcing.TransitiveGround
15
-
16
- open SetFormula
17
- universe u
18
- variable (M : TransitiveGround.{u})
19
-
20
- theorem realize_orientedPairFormula
21
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
22
- {n : Nat} (reverse : Bool) (x y r : Fin n) (env : Fin n → ZFSet.{u})
23
- (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) (hr : env r ∈ M.sets) :
24
- Realize M.sets (orientedPairFormula reverse x y r) env ↔
25
- if reverse then ZFSet.pair (env y) (env x) ∈ env r else ZFSet.pair (env x) (env y) ∈ env r := by
26
- cases reverse
27
- · exact M.realize_pairMembershipFormula pairing x y r env hx hy hr
28
- · exact M.realize_pairMembershipFormula pairing y x r env hy hx hr
29
-
30
- end PartitionPilot.Forcing.TransitiveGround
31
-
32
-
33
-
34
- namespace PartitionPilot.Forcing.SetFormula
35
-
36
- def renameMatchFormula {n : Nat} (reverse : Bool) (c f r x y : Fin n) : SetFormula n :=
37
- .all (allConditions c.succ (imp (pairMembershipFormula 1 0 x.succ.succ)
38
- (ex (exConditions c.succ.succ.succ
39
- (.conj (pairMembershipFormula 1 0 y.succ.succ.succ.succ)
40
- (.conj (orientedPairFormula reverse 2 0 f.succ.succ.succ.succ)
41
- (orientedPairFormula reverse 3 1 r.succ.succ.succ.succ)))))))
42
-
43
- def renameStepFormula {n : Nat} (c f r x y : Fin n) : SetFormula n :=
44
- .conj (renameMatchFormula false c f r x y) (renameMatchFormula true c f r y x)
45
-
46
- end PartitionPilot.Forcing.SetFormula
47
-
48
- namespace PartitionPilot.Forcing.TransitiveGround
49
-
50
- open SetRealization SetFormula
51
- universe u
52
- variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P)
53
-
54
- def RawRenameMatch (reverse : Bool) (f : P → P) (R x y : ZFSet.{u}) : Prop :=
55
- ∀ v ∈ M.sets, ∀ p, ZFSet.pair v (s.encode p) ∈ x →
56
- ∃ w ∈ M.sets, ∃ q, ZFSet.pair w (s.encode q) ∈ y ∧
57
- (if reverse then f q = p else f p = q) ∧
58
- (if reverse then ZFSet.pair w v ∈ R else ZFSet.pair v w ∈ R)
59
-
60
- def RawRenameStep (f : P → P) (R x y : ZFSet.{u}) : Prop :=
61
- M.RawRenameMatch s false f R x y ∧ M.RawRenameMatch s true f R y x
62
-
63
- theorem rawRenameStep_mono (f : P → P) {R S x y : ZFSet.{u}} (sub : R ⊆ S)
64
- (h : M.RawRenameStep s f R x y) : M.RawRenameStep s f S x y := by
65
- constructor
66
- · intro v hv p entry
67
- obtain ⟨w, hw, q, matched, cond, rel⟩ := h.1 v hv p entry
68
- exact ⟨w, hw, q, matched, cond, sub rel⟩
69
- · intro w hw q entry
70
- obtain ⟨v, hv, p, matched, cond, rel⟩ := h.2 w hw q entry
71
- exact ⟨v, hv, p, matched, cond, sub rel⟩
72
-
73
- theorem realize_orientedMapFormula
74
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
75
- (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets)
76
- {n : Nat} (reverse : Bool) (i j k : Fin n) (env : Fin n → ZFSet.{u}) (p q : P)
77
- (hi : env i = s.encode p) (hj : env j = s.encode q) (hk : env k = s.graph s f) :
78
- Realize M.sets (orientedPairFormula reverse i j k) env ↔
79
- if reverse then f q = p else f p = q := by
80
- rw [M.realize_orientedPairFormula pairing reverse i j k env
81
- (hi ▸ M.transitive carrier (s.encode_mem p)) (hj ▸ M.transitive carrier (s.encode_mem q))
82
- (hk ▸ graph), hi, hj, hk]
83
- cases reverse
84
- · exact s.pair_mem_graph s f p q
85
- · exact s.pair_mem_graph s f q p
86
-
87
- theorem realize_renameMatchFormula
88
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
89
- (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets)
90
- {n : Nat} (reverse : Bool) (c g r x y : Fin n) (env : Fin n → ZFSet.{u})
91
- (hc : env c = s.carrier) (hg : env g = s.graph s f)
92
- (hr : env r ∈ M.sets) (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) :
93
- Realize M.sets (renameMatchFormula reverse c g r x y) env ↔
94
- M.RawRenameMatch s reverse f (env r) (env x) (env y) := by
95
- change (∀ v ∈ M.sets, Realize M.sets _ (extend v env)) ↔ _
96
- apply forall_congr'
97
- intro v
98
- apply forall_congr'
99
- intro hv
100
- rw [M.realize_allConditions s c.succ _ (extend v env) carrier hc]
101
- apply forall_congr'
102
- intro p
103
- rw [realize_imp, M.realize_pairMembershipFormula pairing 1 0 x.succ.succ
104
- (extend (s.encode p) (extend v env)) hv (M.transitive carrier (s.encode_mem p)) hx]
105
- apply forall_congr'
106
- intro _
107
- rw [realize_ex]
108
- apply exists_congr
109
- intro w
110
- apply and_congr_right
111
- intro hw
112
- rw [M.realize_exConditions s c.succ.succ.succ _ (extend w (extend (s.encode p) (extend v env)))
113
- carrier hc]
114
- apply exists_congr
115
- intro q
116
- let e := extend (s.encode q) (extend w (extend (s.encode p) (extend v env)))
117
- change (Realize M.sets _ e ∧ Realize M.sets _ e ∧ Realize M.sets _ e) �� _
118
- rw [M.realize_pairMembershipFormula pairing 1 0 y.succ.succ.succ.succ e hw
119
- (M.transitive carrier (s.encode_mem q)) hy,
120
- M.realize_orientedMapFormula s pairing carrier f graph reverse 2 0 g.succ.succ.succ.succ e p q rfl rfl hg,
121
- M.realize_orientedPairFormula pairing reverse 3 1 r.succ.succ.succ.succ e hv hw hr]
122
- rfl
123
-
124
- theorem realize_renameStepFormula
125
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
126
- (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets)
127
- {n : Nat} (c g r x y : Fin n) (env : Fin n → ZFSet.{u})
128
- (hc : env c = s.carrier) (hg : env g = s.graph s f)
129
- (hr : env r ∈ M.sets) (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) :
130
- Realize M.sets (renameStepFormula c g r x y) env ↔
131
- M.RawRenameStep s f (env r) (env x) (env y) := by
132
- change (Realize M.sets _ env ∧ Realize M.sets _ env) ↔ _
133
- rw [M.realize_renameMatchFormula s pairing carrier f graph false c g r x y env hc hg hr hx hy,
134
- M.realize_renameMatchFormula s pairing carrier f graph true c g r y x env hc hg hr hy hx]
135
- rfl
136
-
137
- end PartitionPilot.Forcing.TransitiveGround
138
-
139
- end
140
-
141
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Forcing.NameRenameSteps
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing.SetFormula
8
+
9
+ def orientedPairFormula {n : Nat} (reverse : Bool) (x y r : Fin n) : SetFormula n :=
10
+ if reverse then pairMembershipFormula y x r else pairMembershipFormula x y r
11
+
12
+ end PartitionPilot.Forcing.SetFormula
13
+
14
+ namespace PartitionPilot.Forcing.TransitiveGround
15
+
16
+ open SetFormula
17
+ universe u
18
+ variable (M : TransitiveGround.{u})
19
+
20
+ theorem realize_orientedPairFormula
21
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
22
+ {n : Nat} (reverse : Bool) (x y r : Fin n) (env : Fin n → ZFSet.{u})
23
+ (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) (hr : env r ∈ M.sets) :
24
+ Realize M.sets (orientedPairFormula reverse x y r) env ↔
25
+ if reverse then ZFSet.pair (env y) (env x) ∈ env r else ZFSet.pair (env x) (env y) ∈ env r := by
26
+ cases reverse
27
+ · exact M.realize_pairMembershipFormula pairing x y r env hx hy hr
28
+ · exact M.realize_pairMembershipFormula pairing y x r env hy hx hr
29
+
30
+ end PartitionPilot.Forcing.TransitiveGround
31
+
32
+
33
+
34
+ namespace PartitionPilot.Forcing.SetFormula
35
+
36
+ def renameMatchFormula {n : Nat} (reverse : Bool) (c f r x y : Fin n) : SetFormula n :=
37
+ .all (allConditions c.succ (imp (pairMembershipFormula 1 0 x.succ.succ)
38
+ (ex (exConditions c.succ.succ.succ
39
+ (.conj (pairMembershipFormula 1 0 y.succ.succ.succ.succ)
40
+ (.conj (orientedPairFormula reverse 2 0 f.succ.succ.succ.succ)
41
+ (orientedPairFormula reverse 3 1 r.succ.succ.succ.succ)))))))
42
+
43
+ def renameStepFormula {n : Nat} (c f r x y : Fin n) : SetFormula n :=
44
+ .conj (renameMatchFormula false c f r x y) (renameMatchFormula true c f r y x)
45
+
46
+ end PartitionPilot.Forcing.SetFormula
47
+
48
+ namespace PartitionPilot.Forcing.TransitiveGround
49
+
50
+ open SetRealization SetFormula
51
+ universe u
52
+ variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P)
53
+
54
+ def RawRenameMatch (reverse : Bool) (f : P → P) (R x y : ZFSet.{u}) : Prop :=
55
+ ∀ v ∈ M.sets, ∀ p, ZFSet.pair v (s.encode p) ∈ x →
56
+ ∃ w ∈ M.sets, ∃ q, ZFSet.pair w (s.encode q) ∈ y ∧
57
+ (if reverse then f q = p else f p = q) ∧
58
+ (if reverse then ZFSet.pair w v ∈ R else ZFSet.pair v w ∈ R)
59
+
60
+ def RawRenameStep (f : P → P) (R x y : ZFSet.{u}) : Prop :=
61
+ M.RawRenameMatch s false f R x y ∧ M.RawRenameMatch s true f R y x
62
+
63
+ theorem rawRenameStep_mono (f : P → P) {R S x y : ZFSet.{u}} (sub : R ⊆ S)
64
+ (h : M.RawRenameStep s f R x y) : M.RawRenameStep s f S x y := by
65
+ constructor
66
+ · intro v hv p entry
67
+ obtain ⟨w, hw, q, matched, cond, rel⟩ := h.1 v hv p entry
68
+ exact ⟨w, hw, q, matched, cond, sub rel⟩
69
+ · intro w hw q entry
70
+ obtain ⟨v, hv, p, matched, cond, rel⟩ := h.2 w hw q entry
71
+ exact ⟨v, hv, p, matched, cond, sub rel⟩
72
+
73
+ theorem realize_orientedMapFormula
74
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
75
+ (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets)
76
+ {n : Nat} (reverse : Bool) (i j k : Fin n) (env : Fin n → ZFSet.{u}) (p q : P)
77
+ (hi : env i = s.encode p) (hj : env j = s.encode q) (hk : env k = s.graph s f) :
78
+ Realize M.sets (orientedPairFormula reverse i j k) env ↔
79
+ if reverse then f q = p else f p = q := by
80
+ rw [M.realize_orientedPairFormula pairing reverse i j k env
81
+ (hi ▸ M.transitive carrier (s.encode_mem p)) (hj ▸ M.transitive carrier (s.encode_mem q))
82
+ (hk ▸ graph), hi, hj, hk]
83
+ cases reverse
84
+ · exact s.pair_mem_graph s f p q
85
+ · exact s.pair_mem_graph s f q p
86
+
87
+ theorem realize_renameMatchFormula
88
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
89
+ (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets)
90
+ {n : Nat} (reverse : Bool) (c g r x y : Fin n) (env : Fin n → ZFSet.{u})
91
+ (hc : env c = s.carrier) (hg : env g = s.graph s f)
92
+ (hr : env r ∈ M.sets) (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) :
93
+ Realize M.sets (renameMatchFormula reverse c g r x y) env ↔
94
+ M.RawRenameMatch s reverse f (env r) (env x) (env y) := by
95
+ change (∀ v ∈ M.sets, Realize M.sets _ (extend v env)) ↔ _
96
+ apply forall_congr'
97
+ intro v
98
+ apply forall_congr'
99
+ intro hv
100
+ rw [M.realize_allConditions s c.succ _ (extend v env) carrier hc]
101
+ apply forall_congr'
102
+ intro p
103
+ rw [realize_imp, M.realize_pairMembershipFormula pairing 1 0 x.succ.succ
104
+ (extend (s.encode p) (extend v env)) hv (M.transitive carrier (s.encode_mem p)) hx]
105
+ apply forall_congr'
106
+ intro _
107
+ rw [realize_ex]
108
+ apply exists_congr
109
+ intro w
110
+ apply and_congr_right
111
+ intro hw
112
+ rw [M.realize_exConditions s c.succ.succ.succ _ (extend w (extend (s.encode p) (extend v env)))
113
+ carrier hc]
114
+ apply exists_congr
115
+ intro q
116
+ let e := extend (s.encode q) (extend w (extend (s.encode p) (extend v env)))
117
+ change (Realize M.sets _ e ∧ Realize M.sets _ e ∧ Realize M.sets _ e) ↔ _
118
+ rw [M.realize_pairMembershipFormula pairing 1 0 y.succ.succ.succ.succ e hw
119
+ (M.transitive carrier (s.encode_mem q)) hy,
120
+ M.realize_orientedMapFormula s pairing carrier f graph reverse 2 0 g.succ.succ.succ.succ e p q rfl rfl hg,
121
+ M.realize_orientedPairFormula pairing reverse 3 1 r.succ.succ.succ.succ e hv hw hr]
122
+ rfl
123
+
124
+ theorem realize_renameStepFormula
125
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
126
+ (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets)
127
+ {n : Nat} (c g r x y : Fin n) (env : Fin n → ZFSet.{u})
128
+ (hc : env c = s.carrier) (hg : env g = s.graph s f)
129
+ (hr : env r ∈ M.sets) (hx : env x ∈ M.sets) (hy : env y ∈ M.sets) :
130
+ Realize M.sets (renameStepFormula c g r x y) env ↔
131
+ M.RawRenameStep s f (env r) (env x) (env y) := by
132
+ change (Realize M.sets _ env ∧ Realize M.sets _ env) ↔ _
133
+ rw [M.realize_renameMatchFormula s pairing carrier f graph false c g r x y env hc hg hr hx hy,
134
+ M.realize_renameMatchFormula s pairing carrier f graph true c g r y x env hc hg hr hy hx]
135
+ rfl
136
+
137
+ end PartitionPilot.Forcing.TransitiveGround
138
+
139
+ end
140
+
141
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/RecursiveActionRealization.lean CHANGED
@@ -1,227 +1,227 @@
1
- import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRecursiveActions
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing.CodedRecursiveMapInputs
8
-
9
- open Compression.RecursiveMaps
10
- universe u
11
- variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}}
12
- variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss}
13
- variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A)
14
- variable (M : TransitiveGround.{u}) (next : h.NextInputs M)
15
-
16
- theorem next_upper (label : h.toInputs.Labels)
17
- (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) :
18
- next.templates.upper (h.nextIndex label) ⟨d.coding.encode x, d.coding.encode_mem x⟩ ↔
19
- h.toInputs.nextBatch.upper label x := by
20
- change d.coding.encode x ∈ next.filter (h.nextIndex label) ↔ _
21
- rw [h.next_filter M next, mem_pushFilterCode]
22
- constructor
23
- · rintro ⟨_, a, ha, z, _, entry, lower⟩
24
- let a' : {a : ZFSet.{u} // a ∈ D} := ⟨a, (d.fiber label.2.val).filter.subset ha⟩
25
- have equal := (show FunctionGraphOn D (h.maps.value label.1) from
26
- ⟨d.batchCarrier, (h.valid _ _ (h.maps.value_entry label.1)).injection.function⟩).unique
27
- entry (h.toInputs_previous_entry label.1 a')
28
- exact ⟨a', ha, (d.coding.le_encode _ x).1 (equal ▸ lower)⟩
29
- · rintro ⟨a, ha, lower⟩
30
- exact ⟨d.coding.encode_mem x, a.val, ha,
31
- d.coding.encode ((h.toInputs.previous label.1).toFun a), d.coding.encode_mem _,
32
- h.toInputs_previous_entry label.1 a, (d.coding.le_encode _ x).2 lower⟩
33
-
34
- theorem nextFresh_shadow (q : h.toInputs.nextBatch.Fresh) :
35
- (next.templates.shadow (h.nextFresh M next q)).val =
36
- d.coding.encode (h.toInputs.nextBatch.shadow q) := by
37
- have oldEntry := (d.fiber q.1.2.val).shadow_entry ⟨(), q.2⟩
38
- obtain ⟨_, _, c, hc, meetEntry, baseEntry⟩ :=
39
- (pair_mem_attachmentShadowGraph _ _ _ _ _ _ _).1 oldEntry
40
- apply Eq.symm
41
- apply next.freshCode_shadow_value (h.nextFresh M next q)
42
- apply (next.batch_shadow_entry_iff (h.nextIndex q.1) q.2.val.val _).2
43
- rw [h.next_space M next, h.next_meet M next, h.next_embed M next, h.next_anchor M next]
44
- apply (pair_mem_attachmentShadowGraph _ _ _ _ _ _ _).2
45
- refine ⟨q.2.val.property, d.coding.encode_mem _, c, hc, meetEntry, ?_⟩
46
- apply (pair_mem_relationCompose _ _ _ _ _ _ _).2
47
- refine ⟨mem_familyPointBound_of_entry (d.space_entry q.1.2.val) hc,
48
- d.coding.encode_mem _, (d.templates.shadow ⟨q.1.2.val, q.2⟩).val,
49
- (d.templates.shadow ⟨q.1.2.val, q.2⟩).property, baseEntry, ?_⟩
50
- exact h.toInputs_previous_entry q.1.1 (d.templates.shadow ⟨q.1.2.val, q.2⟩)
51
-
52
- noncomputable def nextNodes :
53
- ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh →
54
- {x : ZFSet.{u} // x ∈ d.batchCarrier} ⊕ next.templates.Fresh
55
- | .inl x => .inl ⟨d.coding.encode x, d.coding.encode_mem x⟩
56
- | .inr q => .inr (h.nextFresh M next q)
57
-
58
- noncomputable def nextEncode
59
- (x : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) :
60
- ZFSet.{u} := next.coding.encode (h.nextNodes M next x)
61
-
62
- theorem nextEncode_old (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) :
63
- h.nextEncode M next (.inl x) = d.coding.encode x := rfl
64
-
65
- theorem nextEncode_fresh (q : h.toInputs.nextBatch.Fresh) :
66
- h.nextEncode M next (.inr q) = ZFSet.pair d.batchCarrier
67
- (ZFSet.pair (ZFSet.pair q.1.1.val q.1.2.val.val) q.2.val.val) := rfl
68
-
69
- theorem nextEncode_mem
70
- (x : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) :
71
- h.nextEncode M next x ∈ next.batchCarrier := next.coding.encode_mem _
72
-
73
- theorem nextNodes_injective : Function.Injective (h.nextNodes M next) := by
74
- intro x y equal
75
- cases x with
76
- | inl x =>
77
- cases y with
78
- | inl y =>
79
- exact congrArg Sum.inl (d.coding.encode_injective
80
- (congrArg Subtype.val (Sum.inl.inj equal)))
81
- | inr y => cases equal
82
- | inr x =>
83
- cases y with
84
- | inl y => cases equal
85
- | inr y => exact congrArg Sum.inr (h.nextFresh_injective M next (Sum.inr.inj equal))
86
-
87
- theorem nextNodes_surjective : Function.Surjective (h.nextNodes M next) := by
88
- intro x
89
- cases x with
90
- | inl x =>
91
- obtain ⟨y, equal⟩ := d.coding.encode_surjective x.val x.property
92
- exact ⟨.inl y, congrArg Sum.inl (Subtype.ext equal)⟩
93
- | inr q =>
94
- obtain ⟨p, equal⟩ := h.nextFresh_surjective M next q
95
- exact ⟨.inr p, congrArg Sum.inr equal⟩
96
-
97
- theorem nextEncode_injective : Function.Injective (h.nextEncode M next) :=
98
- fun _ _ equal => h.nextNodes_injective M next (next.coding.encode_injective equal)
99
-
100
- theorem nextEncode_surjective : ∀ z ∈ next.batchCarrier,
101
- ∃ x, h.nextEncode M next x = z := by
102
- intro z hz
103
- obtain ⟨y, equal⟩ := next.coding.encode_surjective z hz
104
- obtain ⟨x, rfl⟩ := h.nextNodes_surjective M next y
105
- exact ⟨x, equal⟩
106
-
107
- theorem next_le_encode
108
- (x y : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) :
109
- ZFSet.pair (h.nextEncode M next x) (h.nextEncode M next y) ∈ next.batchOrder ↔
110
- h.toInputs.nextBatch.extension.le x y := by
111
- change ZFSet.pair (next.coding.encode (h.nextNodes M next x))
112
- (next.coding.encode (h.nextNodes M next y)) ∈ next.batchOrder ↔ _
113
- rw [next.coding.le_encode]
114
- cases x with
115
- | inl x =>
116
- cases y with
117
- | inl y => exact d.coding.le_encode x y
118
- | inr q =>
119
- change ZFSet.pair (d.coding.encode x) (next.templates.shadow (h.nextFresh M next q)).val ∈
120
- d.batchOrder ↔ d.templates.extension.le x (h.toInputs.nextBatch.shadow q)
121
- rw [h.nextFresh_shadow M next]
122
- exact d.coding.le_encode x _
123
- | inr q =>
124
- cases y with
125
- | inl y => exact h.next_upper M next q.1 y
126
- | inr t =>
127
- change (next.templates.Inside (h.nextFresh M next q) (h.nextFresh M next t) ∨
128
- next.templates.upper (h.nextIndex q.1) (next.templates.shadow (h.nextFresh M next t))) ↔
129
- (h.toInputs.nextBatch.Inside q t ∨
130
- h.toInputs.nextBatch.upper q.1 (h.toInputs.nextBatch.shadow t))
131
- apply or_congr (h.nextFresh_inside_iff M next q t)
132
- have equal : next.templates.shadow (h.nextFresh M next t) =
133
- ⟨d.coding.encode (h.toInputs.nextBatch.shadow t), d.coding.encode_mem _⟩ :=
134
- Subtype.ext (h.nextFresh_shadow M next t)
135
- rw [equal]
136
- exact h.next_upper M next q.1 _
137
-
138
- theorem next_meet_entry
139
- (x y : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) :
140
- ZFSet.pair (ZFSet.pair (h.nextEncode M next x) (h.nextEncode M next y))
141
- (h.nextEncode M next (h.toInputs.nextBatch.extension.meet x y)) ∈ next.batchMeetGraph := by
142
- apply next.batch_meetOrder.pair_iff.2
143
- refine ⟨h.nextEncode_mem M next x, h.nextEncode_mem M next y, h.nextEncode_mem M next _,
144
- (h.next_le_encode M next _ x).2 (h.toInputs.nextBatch.extension.meet_le_left x y),
145
- (h.next_le_encode M next _ y).2 (h.toInputs.nextBatch.extension.meet_le_right x y), ?_⟩
146
- intro z hz zx zy
147
- obtain ⟨w, rfl⟩ := h.nextEncode_surjective M next z hz
148
- exact (h.next_le_encode M next _ _).2 (h.toInputs.nextBatch.extension.le_meet
149
- ((h.next_le_encode M next _ _).1 zx) ((h.next_le_encode M next _ _).1 zy))
150
-
151
- end PartitionPilot.Forcing.CodedRecursiveMapInputs
152
-
153
-
154
-
155
- namespace PartitionPilot.Forcing.CodedRecursiveTaskAction
156
-
157
- universe u
158
- variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}}
159
- variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss}
160
- variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A}
161
- variable (s : CodedRecursiveTaskAction h T)
162
- variable (M : TransitiveGround.{u}) (next : h.NextInputs M)
163
-
164
- theorem nextAction_entry (g : {g : ZFSet.{u} // g ∈ G})
165
- (x : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) :
166
- ZFSet.pair (ZFSet.pair g.val (h.nextEncode M next x))
167
- (h.nextEncode M next ((s.toTaskSymmetry g).nextIso.toFun x)) ∈ h.nextActionGraph T := by
168
- cases x with
169
- | inl x =>
170
- rw [(s.toTaskSymmetry g).nextIso_old, h.nextEncode_old, h.nextEncode_old]
171
- exact (h.nextAction_old_iff (d.coding.encode_mem x)).2 (s.toTaskSymmetry_current_entry g x)
172
- | inr q =>
173
- rw [(s.toTaskSymmetry g).nextIso_fresh, h.nextEncode_fresh, h.nextEncode_fresh]
174
- exact h.nextAction_fresh_entry s.taskAction s.source
175
- (s.toTaskSymmetry_perm_entry g q.1.1) (next.freshCode_mem (h.nextFresh M next q))
176
-
177
- theorem nextAction_entry_iff (g : {g : ZFSet.{u} // g ∈ G})
178
- (x : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh)
179
- (y : ZFSet.{u}) :
180
- ZFSet.pair (ZFSet.pair g.val (h.nextEncode M next x)) y ∈ h.nextActionGraph T ↔
181
- y = h.nextEncode M next ((s.toTaskSymmetry g).nextIso.toFun x) := by
182
- constructor
183
- · intro entry
184
- exact (h.nextAction_setAction s.taskAction s.source M next).entry_unique entry
185
- (s.nextAction_entry M next g x)
186
- · intro equal
187
- exact equal.symm ▸ s.nextAction_entry M next g x
188
-
189
- include s in
190
- theorem nextAction_order_iff {g x y x' y' : ZFSet.{u}}
191
- (first : ZFSet.pair (ZFSet.pair g x) x' ∈ h.nextActionGraph T)
192
- (second : ZFSet.pair (ZFSet.pair g y) y' ∈ h.nextActionGraph T) :
193
- ZFSet.pair x' y' ∈ next.batchOrder ↔ ZFSet.pair x y ∈ next.batchOrder := by
194
- have sx := (h.nextAction_setAction s.taskAction s.source M next).entry_shape first
195
- have sy := (h.nextAction_setAction s.taskAction s.source M next).entry_shape second
196
- let actor : {g : ZFSet.{u} // g ∈ G} := ⟨g, sx.1⟩
197
- obtain ⟨a, rfl⟩ := h.nextEncode_surjective M next x sx.2.1
198
- obtain ⟨b, rfl⟩ := h.nextEncode_surjective M next y sy.2.1
199
- rw [(s.nextAction_entry_iff M next actor a x').1 first,
200
- (s.nextAction_entry_iff M next actor b y').1 second, h.next_le_encode, h.next_le_encode]
201
- exact (s.toTaskSymmetry actor).nextIso.le_iff a b
202
-
203
- include s in
204
- theorem nextAction_code :
205
- PosetActionCode G next.batchCarrier m one next.batchOrder (h.nextActionGraph T) where
206
- function := (h.nextAction_setAction s.taskAction s.source M next).function
207
- one := (h.nextAction_setAction s.taskAction s.source M next).one
208
- mul := (h.nextAction_setAction s.taskAction s.source M next).mul
209
- monotone := fun _ _ _ _ _ _ _ _ _ _ first second lower =>
210
- (s.nextAction_order_iff M next first second).2 lower
211
-
212
- include s in
213
- theorem nextAction_map_meet {g x y z x' y' z' : ZFSet.{u}}
214
- (meet : ZFSet.pair (ZFSet.pair x y) z ∈ next.batchMeetGraph)
215
- (first : ZFSet.pair (ZFSet.pair g x) x' ∈ h.nextActionGraph T)
216
- (second : ZFSet.pair (ZFSet.pair g y) y' ∈ h.nextActionGraph T)
217
- (third : ZFSet.pair (ZFSet.pair g z) z' ∈ h.nextActionGraph T) :
218
- ZFSet.pair (ZFSet.pair x' y') z' ∈ next.batchMeetGraph :=
219
- (s.nextAction_code M next).raw_map_meet h.group next.batch_meetOrder
220
- ((h.nextAction_setAction s.taskAction s.source M next).entry_shape first).1
221
- meet first second third
222
-
223
- end PartitionPilot.Forcing.CodedRecursiveTaskAction
224
-
225
- end
226
-
227
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Forcing.GroundRecursiveActions
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing.CodedRecursiveMapInputs
8
+
9
+ open Compression.RecursiveMaps
10
+ universe u
11
+ variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A : ZFSet.{u}}
12
+ variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss}
13
+ variable (h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A)
14
+ variable (M : TransitiveGround.{u}) (next : h.NextInputs M)
15
+
16
+ theorem next_upper (label : h.toInputs.Labels)
17
+ (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) :
18
+ next.templates.upper (h.nextIndex label) ⟨d.coding.encode x, d.coding.encode_mem x⟩ ↔
19
+ h.toInputs.nextBatch.upper label x := by
20
+ change d.coding.encode x ∈ next.filter (h.nextIndex label) ↔ _
21
+ rw [h.next_filter M next, mem_pushFilterCode]
22
+ constructor
23
+ · rintro ⟨_, a, ha, z, _, entry, lower⟩
24
+ let a' : {a : ZFSet.{u} // a ∈ D} := ⟨a, (d.fiber label.2.val).filter.subset ha⟩
25
+ have equal := (show FunctionGraphOn D (h.maps.value label.1) from
26
+ ⟨d.batchCarrier, (h.valid _ _ (h.maps.value_entry label.1)).injection.function⟩).unique
27
+ entry (h.toInputs_previous_entry label.1 a')
28
+ exact ⟨a', ha, (d.coding.le_encode _ x).1 (equal ▸ lower)⟩
29
+ · rintro ⟨a, ha, lower⟩
30
+ exact ⟨d.coding.encode_mem x, a.val, ha,
31
+ d.coding.encode ((h.toInputs.previous label.1).toFun a), d.coding.encode_mem _,
32
+ h.toInputs_previous_entry label.1 a, (d.coding.le_encode _ x).2 lower⟩
33
+
34
+ theorem nextFresh_shadow (q : h.toInputs.nextBatch.Fresh) :
35
+ (next.templates.shadow (h.nextFresh M next q)).val =
36
+ d.coding.encode (h.toInputs.nextBatch.shadow q) := by
37
+ have oldEntry := (d.fiber q.1.2.val).shadow_entry ⟨(), q.2⟩
38
+ obtain ⟨_, _, c, hc, meetEntry, baseEntry⟩ :=
39
+ (pair_mem_attachmentShadowGraph _ _ _ _ _ _ _).1 oldEntry
40
+ apply Eq.symm
41
+ apply next.freshCode_shadow_value (h.nextFresh M next q)
42
+ apply (next.batch_shadow_entry_iff (h.nextIndex q.1) q.2.val.val _).2
43
+ rw [h.next_space M next, h.next_meet M next, h.next_embed M next, h.next_anchor M next]
44
+ apply (pair_mem_attachmentShadowGraph _ _ _ _ _ _ _).2
45
+ refine ⟨q.2.val.property, d.coding.encode_mem _, c, hc, meetEntry, ?_⟩
46
+ apply (pair_mem_relationCompose _ _ _ _ _ _ _).2
47
+ refine ⟨mem_familyPointBound_of_entry (d.space_entry q.1.2.val) hc,
48
+ d.coding.encode_mem _, (d.templates.shadow ⟨q.1.2.val, q.2⟩).val,
49
+ (d.templates.shadow ⟨q.1.2.val, q.2⟩).property, baseEntry, ?_⟩
50
+ exact h.toInputs_previous_entry q.1.1 (d.templates.shadow ⟨q.1.2.val, q.2⟩)
51
+
52
+ noncomputable def nextNodes :
53
+ ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh →
54
+ {x : ZFSet.{u} // x ∈ d.batchCarrier} ⊕ next.templates.Fresh
55
+ | .inl x => .inl ⟨d.coding.encode x, d.coding.encode_mem x⟩
56
+ | .inr q => .inr (h.nextFresh M next q)
57
+
58
+ noncomputable def nextEncode
59
+ (x : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) :
60
+ ZFSet.{u} := next.coding.encode (h.nextNodes M next x)
61
+
62
+ theorem nextEncode_old (x : {x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) :
63
+ h.nextEncode M next (.inl x) = d.coding.encode x := rfl
64
+
65
+ theorem nextEncode_fresh (q : h.toInputs.nextBatch.Fresh) :
66
+ h.nextEncode M next (.inr q) = ZFSet.pair d.batchCarrier
67
+ (ZFSet.pair (ZFSet.pair q.1.1.val q.1.2.val.val) q.2.val.val) := rfl
68
+
69
+ theorem nextEncode_mem
70
+ (x : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) :
71
+ h.nextEncode M next x ∈ next.batchCarrier := next.coding.encode_mem _
72
+
73
+ theorem nextNodes_injective : Function.Injective (h.nextNodes M next) := by
74
+ intro x y equal
75
+ cases x with
76
+ | inl x =>
77
+ cases y with
78
+ | inl y =>
79
+ exact congrArg Sum.inl (d.coding.encode_injective
80
+ (congrArg Subtype.val (Sum.inl.inj equal)))
81
+ | inr y => cases equal
82
+ | inr x =>
83
+ cases y with
84
+ | inl y => cases equal
85
+ | inr y => exact congrArg Sum.inr (h.nextFresh_injective M next (Sum.inr.inj equal))
86
+
87
+ theorem nextNodes_surjective : Function.Surjective (h.nextNodes M next) := by
88
+ intro x
89
+ cases x with
90
+ | inl x =>
91
+ obtain ⟨y, equal⟩ := d.coding.encode_surjective x.val x.property
92
+ exact ⟨.inl y, congrArg Sum.inl (Subtype.ext equal)⟩
93
+ | inr q =>
94
+ obtain ⟨p, equal⟩ := h.nextFresh_surjective M next q
95
+ exact ⟨.inr p, congrArg Sum.inr equal⟩
96
+
97
+ theorem nextEncode_injective : Function.Injective (h.nextEncode M next) :=
98
+ fun _ _ equal => h.nextNodes_injective M next (next.coding.encode_injective equal)
99
+
100
+ theorem nextEncode_surjective : ∀ z ∈ next.batchCarrier,
101
+ ∃ x, h.nextEncode M next x = z := by
102
+ intro z hz
103
+ obtain ⟨y, equal⟩ := next.coding.encode_surjective z hz
104
+ obtain ⟨x, rfl⟩ := h.nextNodes_surjective M next y
105
+ exact ⟨x, equal⟩
106
+
107
+ theorem next_le_encode
108
+ (x y : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) :
109
+ ZFSet.pair (h.nextEncode M next x) (h.nextEncode M next y) ∈ next.batchOrder ↔
110
+ h.toInputs.nextBatch.extension.le x y := by
111
+ change ZFSet.pair (next.coding.encode (h.nextNodes M next x))
112
+ (next.coding.encode (h.nextNodes M next y)) ∈ next.batchOrder ↔ _
113
+ rw [next.coding.le_encode]
114
+ cases x with
115
+ | inl x =>
116
+ cases y with
117
+ | inl y => exact d.coding.le_encode x y
118
+ | inr q =>
119
+ change ZFSet.pair (d.coding.encode x) (next.templates.shadow (h.nextFresh M next q)).val ∈
120
+ d.batchOrder ↔ d.templates.extension.le x (h.toInputs.nextBatch.shadow q)
121
+ rw [h.nextFresh_shadow M next]
122
+ exact d.coding.le_encode x _
123
+ | inr q =>
124
+ cases y with
125
+ | inl y => exact h.next_upper M next q.1 y
126
+ | inr t =>
127
+ change (next.templates.Inside (h.nextFresh M next q) (h.nextFresh M next t) ∨
128
+ next.templates.upper (h.nextIndex q.1) (next.templates.shadow (h.nextFresh M next t))) ↔
129
+ (h.toInputs.nextBatch.Inside q t ∨
130
+ h.toInputs.nextBatch.upper q.1 (h.toInputs.nextBatch.shadow t))
131
+ apply or_congr (h.nextFresh_inside_iff M next q t)
132
+ have equal : next.templates.shadow (h.nextFresh M next t) =
133
+ ⟨d.coding.encode (h.toInputs.nextBatch.shadow t), d.coding.encode_mem _⟩ :=
134
+ Subtype.ext (h.nextFresh_shadow M next t)
135
+ rw [equal]
136
+ exact h.next_upper M next q.1 _
137
+
138
+ theorem next_meet_entry
139
+ (x y : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) :
140
+ ZFSet.pair (ZFSet.pair (h.nextEncode M next x) (h.nextEncode M next y))
141
+ (h.nextEncode M next (h.toInputs.nextBatch.extension.meet x y)) ∈ next.batchMeetGraph := by
142
+ apply next.batch_meetOrder.pair_iff.2
143
+ refine ⟨h.nextEncode_mem M next x, h.nextEncode_mem M next y, h.nextEncode_mem M next _,
144
+ (h.next_le_encode M next _ x).2 (h.toInputs.nextBatch.extension.meet_le_left x y),
145
+ (h.next_le_encode M next _ y).2 (h.toInputs.nextBatch.extension.meet_le_right x y), ?_⟩
146
+ intro z hz zx zy
147
+ obtain ⟨w, rfl⟩ := h.nextEncode_surjective M next z hz
148
+ exact (h.next_le_encode M next _ _).2 (h.toInputs.nextBatch.extension.le_meet
149
+ ((h.next_le_encode M next _ _).1 zx) ((h.next_le_encode M next _ _).1 zy))
150
+
151
+ end PartitionPilot.Forcing.CodedRecursiveMapInputs
152
+
153
+
154
+
155
+ namespace PartitionPilot.Forcing.CodedRecursiveTaskAction
156
+
157
+ universe u
158
+ variable {D rD μD J Qs rs μs As Es Fs Ss I Maps Sources Reps G m inv one A T : ZFSet.{u}}
159
+ variable {d : AttachmentBatchInputs D rD μD J Qs rs μs As Es Fs Ss}
160
+ variable {h : CodedRecursiveMapInputs d I Maps Sources Reps G m inv one A}
161
+ variable (s : CodedRecursiveTaskAction h T)
162
+ variable (M : TransitiveGround.{u}) (next : h.NextInputs M)
163
+
164
+ theorem nextAction_entry (g : {g : ZFSet.{u} // g ∈ G})
165
+ (x : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh) :
166
+ ZFSet.pair (ZFSet.pair g.val (h.nextEncode M next x))
167
+ (h.nextEncode M next ((s.toTaskSymmetry g).nextIso.toFun x)) ∈ h.nextActionGraph T := by
168
+ cases x with
169
+ | inl x =>
170
+ rw [(s.toTaskSymmetry g).nextIso_old, h.nextEncode_old, h.nextEncode_old]
171
+ exact (h.nextAction_old_iff (d.coding.encode_mem x)).2 (s.toTaskSymmetry_current_entry g x)
172
+ | inr q =>
173
+ rw [(s.toTaskSymmetry g).nextIso_fresh, h.nextEncode_fresh, h.nextEncode_fresh]
174
+ exact h.nextAction_fresh_entry s.taskAction s.source
175
+ (s.toTaskSymmetry_perm_entry g q.1.1) (next.freshCode_mem (h.nextFresh M next q))
176
+
177
+ theorem nextAction_entry_iff (g : {g : ZFSet.{u} // g ∈ G})
178
+ (x : ({x : ZFSet.{u} // x ∈ D} ⊕ d.templates.Fresh) ⊕ h.toInputs.nextBatch.Fresh)
179
+ (y : ZFSet.{u}) :
180
+ ZFSet.pair (ZFSet.pair g.val (h.nextEncode M next x)) y ∈ h.nextActionGraph T ↔
181
+ y = h.nextEncode M next ((s.toTaskSymmetry g).nextIso.toFun x) := by
182
+ constructor
183
+ · intro entry
184
+ exact (h.nextAction_setAction s.taskAction s.source M next).entry_unique entry
185
+ (s.nextAction_entry M next g x)
186
+ · intro equal
187
+ exact equal.symm ▸ s.nextAction_entry M next g x
188
+
189
+ include s in
190
+ theorem nextAction_order_iff {g x y x' y' : ZFSet.{u}}
191
+ (first : ZFSet.pair (ZFSet.pair g x) x' ∈ h.nextActionGraph T)
192
+ (second : ZFSet.pair (ZFSet.pair g y) y' ∈ h.nextActionGraph T) :
193
+ ZFSet.pair x' y' ∈ next.batchOrder ↔ ZFSet.pair x y ∈ next.batchOrder := by
194
+ have sx := (h.nextAction_setAction s.taskAction s.source M next).entry_shape first
195
+ have sy := (h.nextAction_setAction s.taskAction s.source M next).entry_shape second
196
+ let actor : {g : ZFSet.{u} // g ∈ G} := ⟨g, sx.1⟩
197
+ obtain ⟨a, rfl⟩ := h.nextEncode_surjective M next x sx.2.1
198
+ obtain ⟨b, rfl⟩ := h.nextEncode_surjective M next y sy.2.1
199
+ rw [(s.nextAction_entry_iff M next actor a x').1 first,
200
+ (s.nextAction_entry_iff M next actor b y').1 second, h.next_le_encode, h.next_le_encode]
201
+ exact (s.toTaskSymmetry actor).nextIso.le_iff a b
202
+
203
+ include s in
204
+ theorem nextAction_code :
205
+ PosetActionCode G next.batchCarrier m one next.batchOrder (h.nextActionGraph T) where
206
+ function := (h.nextAction_setAction s.taskAction s.source M next).function
207
+ one := (h.nextAction_setAction s.taskAction s.source M next).one
208
+ mul := (h.nextAction_setAction s.taskAction s.source M next).mul
209
+ monotone := fun _ _ _ _ _ _ _ _ _ _ first second lower =>
210
+ (s.nextAction_order_iff M next first second).2 lower
211
+
212
+ include s in
213
+ theorem nextAction_map_meet {g x y z x' y' z' : ZFSet.{u}}
214
+ (meet : ZFSet.pair (ZFSet.pair x y) z ∈ next.batchMeetGraph)
215
+ (first : ZFSet.pair (ZFSet.pair g x) x' ∈ h.nextActionGraph T)
216
+ (second : ZFSet.pair (ZFSet.pair g y) y' ∈ h.nextActionGraph T)
217
+ (third : ZFSet.pair (ZFSet.pair g z) z' ∈ h.nextActionGraph T) :
218
+ ZFSet.pair (ZFSet.pair x' y') z' ∈ next.batchMeetGraph :=
219
+ (s.nextAction_code M next).raw_map_meet h.group next.batch_meetOrder
220
+ ((h.nextAction_setAction s.taskAction s.source M next).entry_shape first).1
221
+ meet first second third
222
+
223
+ end PartitionPilot.Forcing.CodedRecursiveTaskAction
224
+
225
+ end
226
+
227
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/RecursivePrimitiveFormulas.lean CHANGED
@@ -1,114 +1,114 @@
1
- import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveLiftAgreement
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
- open SetFormula
9
- universe u
10
-
11
- namespace SetFormula
12
- def recursiveIndicesSetFormula {n} (output i j p bound sources filters : Fin n) : SetFormula n :=
13
- exactSetFormula output (BoundedFormula.recursiveAttachmentIndexFormula 0 i.succ j.succ
14
- p.succ bound.succ sources.succ filters.succ).toFormula
15
-
16
- def pairFieldSetFormula {n} (left : Bool) (output i j k bound family : Fin n) : SetFormula n :=
17
- exactSetFormula output (BoundedFormula.pairFieldEntryFormula left 0 k.succ i.succ j.succ
18
- bound.succ family.succ).toFormula
19
-
20
- def indexedFreshSetFormula {n} (output i qs rs anchors qb rb ab : Fin n) : SetFormula n :=
21
- exactSetFormula output (BoundedFormula.indexedAttachmentFreshEntryFormula 0 i.succ qs.succ
22
- rs.succ anchors.succ qb.succ rb.succ ab.succ).toFormula
23
-
24
- end SetFormula
25
-
26
- namespace TransitiveGround
27
- variable (M : TransitiveGround.{u})
28
- variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
29
- variable (unions : Realize M.sets SetFormula.union Fin.elim0)
30
- variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
31
- include pairing unions powers separation
32
-
33
- theorem realize_recursiveIndicesSetFormula {n} (output i j p bound sources filters : Fin n)
34
- (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets) :
35
- Realize M.sets (recursiveIndicesSetFormula output i j p bound sources filters) env ↔
36
- env output = recursiveAttachmentIndices (env i) (env j) (env p) (env bound)
37
- (env sources) (env filters) := by
38
- apply M.realize_exactBoundedSetFormula output _ env members
39
- (M.recursiveAttachmentIndices_mem pairing unions powers separation (members i) (members j)
40
- (members p) (members bound) (members sources) (members filters))
41
- intro z
42
- rw [BoundedFormula.truth_recursiveAttachmentIndexFormula]
43
- change (∃ x ∈ env i, ∃ y ∈ env j, ∃ a ∈ env p, ∃ F ∈ env bound,
44
- z = ZFSet.pair x y ∧ ZFSet.pair x a ∈ env sources ∧
45
- ZFSet.pair y F ∈ env filters ∧ a ∉ F) ↔ _
46
- rw [recursiveAttachmentIndices, ZFSet.mem_sep]
47
- constructor
48
- · intro witness
49
- refine ⟨?_, witness⟩
50
- obtain ⟨x, hx, y, hy, _, _, _, _, equal, _⟩ := witness
51
- rw [equal]
52
- exact ZFSet.pair_mem_prod.2 ⟨hx, hy⟩
53
- · exact And.right
54
-
55
- theorem realize_pairFieldSetFormula {n} (left : Bool) (output i j k bound family : Fin n)
56
- (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets) :
57
- Realize M.sets (pairFieldSetFormula left output i j k bound family) env ↔
58
- env output = pairFieldGraph left (env i) (env j) (env k) (env bound) (env family) := by
59
- apply M.realize_exactBoundedSetFormula output _ env members
60
- (M.pairFieldGraph_mem pairing unions powers separation left (members i) (members j)
61
- (members k) (members bound) (members family))
62
- intro z
63
- rw [BoundedFormula.truth_pairFieldEntryFormula]
64
- change (∃ t ∈ env k, ∃ x ∈ env i, ∃ y ∈ env j, ∃ v ∈ env bound,
65
- z = ZFSet.pair t v ∧ t = ZFSet.pair x y ∧
66
- ZFSet.pair (if left then x else y) v ∈ env family) ↔ _
67
- rw [pairFieldGraph, ZFSet.mem_sep]
68
- constructor
69
- · intro witness
70
- refine ⟨?_, witness⟩
71
- obtain ⟨t, ht, _, _, _, _, v, hv, equal, _⟩ := witness
72
- rw [equal]
73
- exact ZFSet.pair_mem_prod.2 ⟨ht, hv⟩
74
- · exact And.right
75
-
76
- theorem realize_pairSecondFieldSetFormula {n} (output i j k bound family : Fin n)
77
- (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets)
78
- (bound_eq : env bound = ZFSet.sUnion (ZFSet.sUnion (env family))) :
79
- Realize M.sets (pairFieldSetFormula false output i j k bound family) env ↔
80
- env output = pairSecondField (env i) (env j) (env k) (env family) := by
81
- rw [M.realize_pairFieldSetFormula pairing unions powers separation false output i j k bound family
82
- env members, bound_eq]
83
- rfl
84
-
85
- theorem realize_indexedFreshSetFormula {n} (output i qs rs anchors qb rb ab : Fin n)
86
- (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets)
87
- (qBound : env qb = ZFSet.sUnion (ZFSet.sUnion (env qs)))
88
- (rBound : env rb = ZFSet.sUnion (ZFSet.sUnion (env rs)))
89
- (aBound : env ab = ZFSet.sUnion (ZFSet.sUnion (env anchors))) :
90
- Realize M.sets (indexedFreshSetFormula output i qs rs anchors qb rb ab) env ↔
91
- env output = indexedAttachmentFresh (env i) (env qs) (env rs) (env anchors) := by
92
- apply M.realize_exactBoundedSetFormula output _ env members
93
- (M.indexedAttachmentFresh_mem pairing unions powers separation (members i) (members qs)
94
- (members rs) (members anchors))
95
- intro z
96
- rw [BoundedFormula.truth_indexedAttachmentFreshEntryFormula]
97
- change (∃ j ∈ env i, ∃ Q ∈ env qb, ∃ r ∈ env rb, ∃ a ∈ env ab, ∃ q ∈ Q,
98
- ZFSet.pair j Q ∈ env qs ∧ ZFSet.pair j r ∈ env rs ∧ ZFSet.pair j a ∈ env anchors ∧
99
- z = ZFSet.pair j q ∧ ZFSet.pair q a ∉ r) ↔ _
100
- rw [qBound, rBound, aBound, indexedAttachmentFresh, ZFSet.mem_sep]
101
- constructor
102
- · intro witness
103
- refine ⟨?_, witness⟩
104
- obtain ⟨j, hj, Q, _, _, _, _, _, q, hq, entry, _, _, equal, _⟩ := witness
105
- rw [equal]
106
- exact (pair_mem_indexedAttachmentDomain (env i) (env qs) j q).2 ⟨hj, Q, entry, hq⟩
107
- · exact And.right
108
-
109
- end TransitiveGround
110
- end PartitionPilot.Forcing
111
-
112
- end
113
-
114
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Transfinite.RecursiveLiftAgreement
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+ open SetFormula
9
+ universe u
10
+
11
+ namespace SetFormula
12
+ def recursiveIndicesSetFormula {n} (output i j p bound sources filters : Fin n) : SetFormula n :=
13
+ exactSetFormula output (BoundedFormula.recursiveAttachmentIndexFormula 0 i.succ j.succ
14
+ p.succ bound.succ sources.succ filters.succ).toFormula
15
+
16
+ def pairFieldSetFormula {n} (left : Bool) (output i j k bound family : Fin n) : SetFormula n :=
17
+ exactSetFormula output (BoundedFormula.pairFieldEntryFormula left 0 k.succ i.succ j.succ
18
+ bound.succ family.succ).toFormula
19
+
20
+ def indexedFreshSetFormula {n} (output i qs rs anchors qb rb ab : Fin n) : SetFormula n :=
21
+ exactSetFormula output (BoundedFormula.indexedAttachmentFreshEntryFormula 0 i.succ qs.succ
22
+ rs.succ anchors.succ qb.succ rb.succ ab.succ).toFormula
23
+
24
+ end SetFormula
25
+
26
+ namespace TransitiveGround
27
+ variable (M : TransitiveGround.{u})
28
+ variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
29
+ variable (unions : Realize M.sets SetFormula.union Fin.elim0)
30
+ variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
31
+ include pairing unions powers separation
32
+
33
+ theorem realize_recursiveIndicesSetFormula {n} (output i j p bound sources filters : Fin n)
34
+ (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets) :
35
+ Realize M.sets (recursiveIndicesSetFormula output i j p bound sources filters) env ↔
36
+ env output = recursiveAttachmentIndices (env i) (env j) (env p) (env bound)
37
+ (env sources) (env filters) := by
38
+ apply M.realize_exactBoundedSetFormula output _ env members
39
+ (M.recursiveAttachmentIndices_mem pairing unions powers separation (members i) (members j)
40
+ (members p) (members bound) (members sources) (members filters))
41
+ intro z
42
+ rw [BoundedFormula.truth_recursiveAttachmentIndexFormula]
43
+ change (∃ x ∈ env i, ∃ y ∈ env j, ∃ a ∈ env p, ∃ F ∈ env bound,
44
+ z = ZFSet.pair x y ∧ ZFSet.pair x a ∈ env sources ∧
45
+ ZFSet.pair y F ∈ env filters ∧ a ∉ F) ↔ _
46
+ rw [recursiveAttachmentIndices, ZFSet.mem_sep]
47
+ constructor
48
+ · intro witness
49
+ refine ⟨?_, witness⟩
50
+ obtain ⟨x, hx, y, hy, _, _, _, _, equal, _⟩ := witness
51
+ rw [equal]
52
+ exact ZFSet.pair_mem_prod.2 ⟨hx, hy⟩
53
+ · exact And.right
54
+
55
+ theorem realize_pairFieldSetFormula {n} (left : Bool) (output i j k bound family : Fin n)
56
+ (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets) :
57
+ Realize M.sets (pairFieldSetFormula left output i j k bound family) env ↔
58
+ env output = pairFieldGraph left (env i) (env j) (env k) (env bound) (env family) := by
59
+ apply M.realize_exactBoundedSetFormula output _ env members
60
+ (M.pairFieldGraph_mem pairing unions powers separation left (members i) (members j)
61
+ (members k) (members bound) (members family))
62
+ intro z
63
+ rw [BoundedFormula.truth_pairFieldEntryFormula]
64
+ change (∃ t ∈ env k, ∃ x ∈ env i, ∃ y ∈ env j, ∃ v ∈ env bound,
65
+ z = ZFSet.pair t v ∧ t = ZFSet.pair x y ∧
66
+ ZFSet.pair (if left then x else y) v ∈ env family) ↔ _
67
+ rw [pairFieldGraph, ZFSet.mem_sep]
68
+ constructor
69
+ · intro witness
70
+ refine ⟨?_, witness⟩
71
+ obtain ⟨t, ht, _, _, _, _, v, hv, equal, _⟩ := witness
72
+ rw [equal]
73
+ exact ZFSet.pair_mem_prod.2 ⟨ht, hv⟩
74
+ · exact And.right
75
+
76
+ theorem realize_pairSecondFieldSetFormula {n} (output i j k bound family : Fin n)
77
+ (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets)
78
+ (bound_eq : env bound = ZFSet.sUnion (ZFSet.sUnion (env family))) :
79
+ Realize M.sets (pairFieldSetFormula false output i j k bound family) env ↔
80
+ env output = pairSecondField (env i) (env j) (env k) (env family) := by
81
+ rw [M.realize_pairFieldSetFormula pairing unions powers separation false output i j k bound family
82
+ env members, bound_eq]
83
+ rfl
84
+
85
+ theorem realize_indexedFreshSetFormula {n} (output i qs rs anchors qb rb ab : Fin n)
86
+ (env : Fin n → ZFSet.{u}) (members : ∀ x, env x ∈ M.sets)
87
+ (qBound : env qb = ZFSet.sUnion (ZFSet.sUnion (env qs)))
88
+ (rBound : env rb = ZFSet.sUnion (ZFSet.sUnion (env rs)))
89
+ (aBound : env ab = ZFSet.sUnion (ZFSet.sUnion (env anchors))) :
90
+ Realize M.sets (indexedFreshSetFormula output i qs rs anchors qb rb ab) env ↔
91
+ env output = indexedAttachmentFresh (env i) (env qs) (env rs) (env anchors) := by
92
+ apply M.realize_exactBoundedSetFormula output _ env members
93
+ (M.indexedAttachmentFresh_mem pairing unions powers separation (members i) (members qs)
94
+ (members rs) (members anchors))
95
+ intro z
96
+ rw [BoundedFormula.truth_indexedAttachmentFreshEntryFormula]
97
+ change (∃ j ∈ env i, ∃ Q ∈ env qb, ∃ r ∈ env rb, ∃ a ∈ env ab, ∃ q ∈ Q,
98
+ ZFSet.pair j Q ∈ env qs ∧ ZFSet.pair j r ∈ env rs ∧ ZFSet.pair j a ∈ env anchors ∧
99
+ z = ZFSet.pair j q ∧ ZFSet.pair q a ∉ r) ↔ _
100
+ rw [qBound, rBound, aBound, indexedAttachmentFresh, ZFSet.mem_sep]
101
+ constructor
102
+ · intro witness
103
+ refine ⟨?_, witness⟩
104
+ obtain ⟨j, hj, Q, _, _, _, _, _, q, hq, entry, _, _, equal, _⟩ := witness
105
+ rw [equal]
106
+ exact (pair_mem_indexedAttachmentDomain (env i) (env qs) j q).2 ⟨hj, Q, entry, hq⟩
107
+ · exact And.right
108
+
109
+ end TransitiveGround
110
+ end PartitionPilot.Forcing
111
+
112
+ end
113
+
114
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementDataHistoryEntryFormulas.lean CHANGED
@@ -1,108 +1,108 @@
1
- import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralHistoryTestUnions
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
- open SetFormula
9
- universe u
10
-
11
- theorem mem_refinementDataHistoryIndices (stages history x : ZFSet.{u}) :
12
- x ∈ refinementDataHistoryIndices stages history ↔
13
- ∃ alpha ∈ stages, ∃ d : Fin 15 → ZFSet.{u},
14
- ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history ∧ x ∈ d 0 := by
15
- rw [refinementDataHistoryIndices, mem_refinementHistoryIndices]
16
- constructor
17
- · rintro ⟨alpha, halpha, I, entry, member⟩
18
- obtain ⟨_, d, stored, rfl⟩ := (pair_mem_refinementDataHistoryField _ _ _ _ _).1 entry
19
- exact ⟨alpha, halpha, d, stored, member⟩
20
- · rintro ⟨alpha, halpha, d, entry, member⟩
21
- exact ⟨alpha, halpha, d 0,
22
- (pair_mem_refinementDataHistoryField _ _ _ _ _).2 ⟨halpha, d, entry, rfl⟩, member⟩
23
-
24
- theorem pair_mem_refinementDataHistoryLevels (stages history T assignment xi : ZFSet.{u}) :
25
- ZFSet.pair assignment xi ∈ refinementDataHistoryLevels stages history T ↔
26
- ∃ i ∈ refinementDataHistoryIndices stages history, ∃ u ∈ T, ∃ w ∈ T,
27
- assignment = stageOneAssignment i u w ∧ xi ∈ stages ∧
28
- ∃ fields : Fin 6 → ZFSet.{u}, i = nonemptyTupleCode 5 fields ∧ xi = fields 0 := by
29
- change ZFSet.pair assignment xi ∈ assignmentIndexLevels
30
- (refinementDataHistoryIndices stages history) T stages
31
- (refinementIndexFieldGraph (refinementDataHistoryIndices stages history) stages 0) ↔ _
32
- rw [pair_mem_assignmentIndexLevels]
33
- constructor
34
- · rintro ⟨i, hi, u, hu, w, hw, equal, hxi, entry⟩
35
- exact ⟨i, hi, u, hu, w, hw, equal, hxi,
36
- ((pair_mem_refinementIndexFieldGraph _ _ _ _ _).1 entry).2.2⟩
37
- · rintro ⟨i, hi, u, hu, w, hw, equal, hxi, fields⟩
38
- exact ⟨i, hi, u, hu, w, hw, equal, hxi,
39
- (pair_mem_refinementIndexFieldGraph _ _ _ _ _).2 ⟨hi, hxi, fields⟩⟩
40
-
41
- namespace BoundedFormula
42
- noncomputable def refinementDataHistoryIndicesEntryFormula {n : Nat}
43
- (stages history x : Fin n) : BoundedFormula n :=
44
- exGraphFields history (.conj (.mem 1 stages.succ.succ)
45
- (exPairFields 0 (.conj (tupleShapeFormula 13 0) (.mem x.succ.succ.succ.succ 1))))
46
-
47
- theorem truth_refinementDataHistoryIndicesEntryFormula {n : Nat}
48
- (stages history x : Fin n) (env : Fin n → ZFSet.{u}) :
49
- Truth (refinementDataHistoryIndicesEntryFormula stages history x) env ↔
50
- env x ∈ refinementDataHistoryIndices (env stages) (env history) := by
51
- rw [mem_refinementDataHistoryIndices]
52
- simp only [refinementDataHistoryIndicesEntryFormula, truth_exGraphFields, Truth,
53
- truth_exPairFields, truth_tupleShapeFormula]
54
- change (∃ alpha data, ZFSet.pair alpha data ∈ env history ∧ alpha ∈ env stages ∧
55
- ∃ I tail, data = ZFSet.pair I tail ∧ (∃ fields : Fin 14 → ZFSet.{u},
56
- tail = nonemptyTupleCode 13 fields) ∧ env x ∈ I) ↔ _
57
- constructor
58
- · rintro ⟨alpha, data, entry, halpha, I, tail, pair, ⟨fields, tuple⟩, member⟩
59
- let d : Fin 15 → ZFSet.{u} := Fin.cases I fields
60
- refine ⟨alpha, halpha, d, ?_, member⟩
61
- have equal : data = refinementFormulaDataCode d := pair.trans (congrArg (ZFSet.pair I) tuple)
62
- exact equal ▸ entry
63
- · rintro ⟨alpha, halpha, d, entry, member⟩
64
- exact ⟨alpha, refinementFormulaDataCode d, entry, halpha, d 0,
65
- nonemptyTupleCode 13 (fun i => d i.succ), rfl,
66
- ⟨fun i => d i.succ, rfl⟩, member⟩
67
-
68
- noncomputable def refinementDataHistoryLevelsEntryFormula {n : Nat}
69
- (stages history T z : Fin n) : BoundedFormula n :=
70
- let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ
71
- exPairFields z (exPairFields 1 (exPairFields 0
72
- (.conj (refinementDataHistoryIndicesEntryFormula (lift stages) (lift history) 3)
73
- (.conj (.mem 1 (lift T)) (.conj (.mem 0 (lift T))
74
- (.conj (.mem 4 (lift stages)) (tupleFieldFormula 5 3 4 0)))))))
75
-
76
- theorem truth_refinementDataHistoryLevelsEntryFormula {n : Nat}
77
- (stages history T z : Fin n) (env : Fin n → ZFSet.{u}) :
78
- Truth (refinementDataHistoryLevelsEntryFormula stages history T z) env ↔
79
- env z ∈ refinementDataHistoryLevels (env stages) (env history) (env T) := by
80
- simp only [refinementDataHistoryLevelsEntryFormula, truth_exPairFields, Truth,
81
- truth_refinementDataHistoryIndicesEntryFormula, truth_tupleFieldFormula]
82
- change (∃ assignment xi, env z = ZFSet.pair assignment xi ∧
83
- ∃ i tail, assignment = ZFSet.pair i tail ∧ ∃ u w, tail = ZFSet.pair u w ∧
84
- i ∈ refinementDataHistoryIndices (env stages) (env history) ∧ u ∈ env T ∧ w ∈ env T ∧
85
- xi ∈ env stages ∧ ∃ fields : Fin 6 → ZFSet.{u},
86
- i = nonemptyTupleCode 5 fields ∧ xi = fields 0) ↔ _
87
- constructor
88
- · rintro ⟨assignment, xi, equal, i, tail, pair, u, w, tailEq, hi, hu, hw, hxi, fields⟩
89
- rw [equal]
90
- apply (pair_mem_refinementDataHistoryLevels _ _ _ _ _).2
91
- exact ⟨i, hi, u, hu, w, hw, pair.trans (congrArg (ZFSet.pair i) tailEq), hxi, fields⟩
92
- · intro member
93
- have raw := member
94
- unfold refinementDataHistoryLevels refinementHistoryAssignmentLevels assignmentIndexLevels relationCompose at raw
95
- have shape := (ZFSet.mem_sep.1 raw).1
96
- obtain ⟨assignment, _, xi, _, equal⟩ := ZFSet.mem_prod.1 shape
97
- rw [equal] at member
98
- obtain ⟨i, hi, u, hu, w, hw, pair, hxi, fields⟩ :=
99
- (pair_mem_refinementDataHistoryLevels _ _ _ _ _).1 member
100
- exact ⟨assignment, xi, equal, i, ZFSet.pair u w, pair, u, w, rfl, hi, hu, hw, hxi, fields⟩
101
-
102
- end BoundedFormula
103
-
104
- end PartitionPilot.Forcing
105
-
106
- end
107
-
108
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundStructuralHistoryTestUnions
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+ open SetFormula
9
+ universe u
10
+
11
+ theorem mem_refinementDataHistoryIndices (stages history x : ZFSet.{u}) :
12
+ x ∈ refinementDataHistoryIndices stages history ↔
13
+ ∃ alpha ∈ stages, ∃ d : Fin 15 → ZFSet.{u},
14
+ ZFSet.pair alpha (refinementFormulaDataCode d) ∈ history ∧ x ∈ d 0 := by
15
+ rw [refinementDataHistoryIndices, mem_refinementHistoryIndices]
16
+ constructor
17
+ · rintro ⟨alpha, halpha, I, entry, member⟩
18
+ obtain ⟨_, d, stored, rfl⟩ := (pair_mem_refinementDataHistoryField _ _ _ _ _).1 entry
19
+ exact ⟨alpha, halpha, d, stored, member⟩
20
+ · rintro ⟨alpha, halpha, d, entry, member⟩
21
+ exact ⟨alpha, halpha, d 0,
22
+ (pair_mem_refinementDataHistoryField _ _ _ _ _).2 ⟨halpha, d, entry, rfl⟩, member⟩
23
+
24
+ theorem pair_mem_refinementDataHistoryLevels (stages history T assignment xi : ZFSet.{u}) :
25
+ ZFSet.pair assignment xi ∈ refinementDataHistoryLevels stages history T ↔
26
+ ∃ i ∈ refinementDataHistoryIndices stages history, ∃ u ∈ T, ∃ w ∈ T,
27
+ assignment = stageOneAssignment i u w ∧ xi ∈ stages ∧
28
+ ∃ fields : Fin 6 → ZFSet.{u}, i = nonemptyTupleCode 5 fields ∧ xi = fields 0 := by
29
+ change ZFSet.pair assignment xi ∈ assignmentIndexLevels
30
+ (refinementDataHistoryIndices stages history) T stages
31
+ (refinementIndexFieldGraph (refinementDataHistoryIndices stages history) stages 0) ↔ _
32
+ rw [pair_mem_assignmentIndexLevels]
33
+ constructor
34
+ · rintro ⟨i, hi, u, hu, w, hw, equal, hxi, entry⟩
35
+ exact ⟨i, hi, u, hu, w, hw, equal, hxi,
36
+ ((pair_mem_refinementIndexFieldGraph _ _ _ _ _).1 entry).2.2⟩
37
+ · rintro ⟨i, hi, u, hu, w, hw, equal, hxi, fields⟩
38
+ exact ⟨i, hi, u, hu, w, hw, equal, hxi,
39
+ (pair_mem_refinementIndexFieldGraph _ _ _ _ _).2 ⟨hi, hxi, fields⟩⟩
40
+
41
+ namespace BoundedFormula
42
+ noncomputable def refinementDataHistoryIndicesEntryFormula {n : Nat}
43
+ (stages history x : Fin n) : BoundedFormula n :=
44
+ exGraphFields history (.conj (.mem 1 stages.succ.succ)
45
+ (exPairFields 0 (.conj (tupleShapeFormula 13 0) (.mem x.succ.succ.succ.succ 1))))
46
+
47
+ theorem truth_refinementDataHistoryIndicesEntryFormula {n : Nat}
48
+ (stages history x : Fin n) (env : Fin n → ZFSet.{u}) :
49
+ Truth (refinementDataHistoryIndicesEntryFormula stages history x) env ↔
50
+ env x ∈ refinementDataHistoryIndices (env stages) (env history) := by
51
+ rw [mem_refinementDataHistoryIndices]
52
+ simp only [refinementDataHistoryIndicesEntryFormula, truth_exGraphFields, Truth,
53
+ truth_exPairFields, truth_tupleShapeFormula]
54
+ change (∃ alpha data, ZFSet.pair alpha data ∈ env history ∧ alpha ∈ env stages ∧
55
+ ∃ I tail, data = ZFSet.pair I tail ∧ (∃ fields : Fin 14 → ZFSet.{u},
56
+ tail = nonemptyTupleCode 13 fields) ∧ env x ∈ I) ↔ _
57
+ constructor
58
+ · rintro ⟨alpha, data, entry, halpha, I, tail, pair, ⟨fields, tuple⟩, member⟩
59
+ let d : Fin 15 → ZFSet.{u} := Fin.cases I fields
60
+ refine ⟨alpha, halpha, d, ?_, member⟩
61
+ have equal : data = refinementFormulaDataCode d := pair.trans (congrArg (ZFSet.pair I) tuple)
62
+ exact equal ▸ entry
63
+ · rintro ⟨alpha, halpha, d, entry, member⟩
64
+ exact ⟨alpha, refinementFormulaDataCode d, entry, halpha, d 0,
65
+ nonemptyTupleCode 13 (fun i => d i.succ), rfl,
66
+ ⟨fun i => d i.succ, rfl⟩, member⟩
67
+
68
+ noncomputable def refinementDataHistoryLevelsEntryFormula {n : Nat}
69
+ (stages history T z : Fin n) : BoundedFormula n :=
70
+ let lift (i : Fin n) := i.succ.succ.succ.succ.succ.succ
71
+ exPairFields z (exPairFields 1 (exPairFields 0
72
+ (.conj (refinementDataHistoryIndicesEntryFormula (lift stages) (lift history) 3)
73
+ (.conj (.mem 1 (lift T)) (.conj (.mem 0 (lift T))
74
+ (.conj (.mem 4 (lift stages)) (tupleFieldFormula 5 3 4 0)))))))
75
+
76
+ theorem truth_refinementDataHistoryLevelsEntryFormula {n : Nat}
77
+ (stages history T z : Fin n) (env : Fin n → ZFSet.{u}) :
78
+ Truth (refinementDataHistoryLevelsEntryFormula stages history T z) env ↔
79
+ env z ∈ refinementDataHistoryLevels (env stages) (env history) (env T) := by
80
+ simp only [refinementDataHistoryLevelsEntryFormula, truth_exPairFields, Truth,
81
+ truth_refinementDataHistoryIndicesEntryFormula, truth_tupleFieldFormula]
82
+ change (∃ assignment xi, env z = ZFSet.pair assignment xi ∧
83
+ ∃ i tail, assignment = ZFSet.pair i tail ∧ ∃ u w, tail = ZFSet.pair u w ∧
84
+ i ∈ refinementDataHistoryIndices (env stages) (env history) ∧ u ∈ env T ∧ w ∈ env T ∧
85
+ xi ∈ env stages ∧ ∃ fields : Fin 6 → ZFSet.{u},
86
+ i = nonemptyTupleCode 5 fields ∧ xi = fields 0) ↔ _
87
+ constructor
88
+ · rintro ⟨assignment, xi, equal, i, tail, pair, u, w, tailEq, hi, hu, hw, hxi, fields⟩
89
+ rw [equal]
90
+ apply (pair_mem_refinementDataHistoryLevels _ _ _ _ _).2
91
+ exact ⟨i, hi, u, hu, w, hw, pair.trans (congrArg (ZFSet.pair i) tailEq), hxi, fields⟩
92
+ · intro member
93
+ have raw := member
94
+ unfold refinementDataHistoryLevels refinementHistoryAssignmentLevels assignmentIndexLevels relationCompose at raw
95
+ have shape := (ZFSet.mem_sep.1 raw).1
96
+ obtain ⟨assignment, _, xi, _, equal⟩ := ZFSet.mem_prod.1 shape
97
+ rw [equal] at member
98
+ obtain ⟨i, hi, u, hu, w, hw, pair, hxi, fields⟩ :=
99
+ (pair_mem_refinementDataHistoryLevels _ _ _ _ _).1 member
100
+ exact ⟨assignment, xi, equal, i, ZFSet.pair u w, pair, u, w, rfl, hi, hu, hw, hxi, fields⟩
101
+
102
+ end BoundedFormula
103
+
104
+ end PartitionPilot.Forcing
105
+
106
+ end
107
+
108
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementHistoryOrderOutputFormulas.lean CHANGED
@@ -1,180 +1,180 @@
1
- import OAI.SetTheory.PartitionPrinciple.Geometry.GroundDefinableRowAssignmentOrders
2
- import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundDefinableRefinementHistories
3
-
4
- namespace OAI
5
-
6
- section
7
-
8
- namespace PartitionPilot.Forcing
9
- open SetRealization SetFormula
10
- universe u
11
-
12
- namespace SetFormula
13
-
14
- noncomputable def refinementHistoryForcingOutputFormula {n : Nat}
15
- (output rows T stages history N : Fin n) : SetFormula n :=
16
- let old := suffixIndex n 2
17
- let v := prefixIndex n 2
18
- exBlock 2 (.conj (refinementDataHistoryIndicesSetFormula (v 0) (old stages) (old history))
19
- (.conj (refinementDataHistoryLevelsSetFormula (v 1) (old stages) (old history) (old T))
20
- (forcingHistoryConditionsOutputFormula (old output) (old rows) (v 0) (old T)
21
- (old stages) (old history) (v 1) (old N))))
22
-
23
- end SetFormula
24
-
25
- namespace TransitiveGround
26
- variable (M : TransitiveGround.{u})
27
- variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
28
- variable (unions : Realize M.sets SetFormula.union Fin.elim0)
29
- variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
30
- include pairing unions powers separation
31
-
32
- theorem realize_refinementHistoryForcingOutputFormula {n : Nat}
33
- (output rows T stages history N : Fin n)
34
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
35
- (naturals : env N = ZFSet.omega) :
36
- Realize M.sets (refinementHistoryForcingOutputFormula output rows T stages history N) env ↔
37
- env output = M.refinementHistoryForcing (env rows) (env T) (env stages) (env history) := by
38
- rw [refinementHistoryForcingOutputFormula, realize_exBlock]
39
- have actual (fields : Fin 2 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) :
40
- Realize M.sets (.conj
41
- (refinementDataHistoryIndicesSetFormula (prefixIndex n 2 0)
42
- (suffixIndex n 2 stages) (suffixIndex n 2 history))
43
- (.conj (refinementDataHistoryLevelsSetFormula (prefixIndex n 2 1)
44
- (suffixIndex n 2 stages) (suffixIndex n 2 history) (suffixIndex n 2 T))
45
- (forcingHistoryConditionsOutputFormula (suffixIndex n 2 output) (suffixIndex n 2 rows)
46
- (prefixIndex n 2 0) (suffixIndex n 2 T) (suffixIndex n 2 stages)
47
- (suffixIndex n 2 history) (prefixIndex n 2 1) (suffixIndex n 2 N))))
48
- (extendMany 2 fields env) ↔
49
- fields 0 = refinementDataHistoryIndices (env stages) (env history) ∧
50
- fields 1 = refinementDataHistoryLevels (env stages) (env history) (env T) ∧
51
- env output = M.forcingHistoryConditions (env rows) (fields 0) (env T)
52
- (env stages) (env history) (fields 1) := by
53
- have bounds := extendMany_members 2 fields env ground members
54
- apply and_congr
55
- · simpa only [extendMany_prefix, extendMany_suffix] using
56
- M.realize_refinementDataHistoryIndicesSetFormula pairing unions powers separation
57
- (prefixIndex n 2 0) (suffixIndex n 2 stages) (suffixIndex n 2 history)
58
- (extendMany 2 fields env) bounds
59
- apply and_congr
60
- · simpa only [extendMany_prefix, extendMany_suffix] using
61
- M.realize_refinementDataHistoryLevelsSetFormula pairing unions powers separation
62
- (prefixIndex n 2 1) (suffixIndex n 2 stages) (suffixIndex n 2 history) (suffixIndex n 2 T)
63
- (extendMany 2 fields env) bounds
64
- · simpa only [extendMany_prefix, extendMany_suffix] using
65
- M.realize_forcingHistoryConditionsOutputFormula pairing separation
66
- (suffixIndex n 2 output) (suffixIndex n 2 rows) (prefixIndex n 2 0)
67
- (suffixIndex n 2 T) (suffixIndex n 2 stages) (suffixIndex n 2 history)
68
- (prefixIndex n 2 1) (suffixIndex n 2 N) (extendMany 2 fields env) bounds
69
- (by simpa only [extendMany_suffix] using naturals)
70
- constructor
71
- · rintro ⟨fields, ground, body⟩
72
- obtain ⟨indices, levels, outputEq⟩ := (actual fields ground).1 body
73
- rw [indices, levels] at outputEq
74
- exact outputEq
75
- · intro equal
76
- let fields : Fin 2 → ZFSet.{u} :=
77
- ![refinementDataHistoryIndices (env stages) (env history),
78
- refinementDataHistoryLevels (env stages) (env history) (env T)]
79
- have ground : ∀ j, fields j ∈ M.sets :=
80
- Fin.cases (M.refinementDataHistoryIndices_mem pairing unions powers separation
81
- (members stages) (members history))
82
- (Fin.cases (M.refinementDataHistoryLevels_mem pairing unions powers separation
83
- (members stages) (members history) (members T)) (fun j => Fin.elim0 j))
84
- exact ⟨fields, ground, (actual fields ground).2 ⟨rfl, rfl, equal⟩⟩
85
-
86
- theorem exists_unique_refinementHistoryForcingOutput
87
- {rows T stages history : ZFSet.{u}}
88
- (hRows : rows ∈ M.sets) (hT : T ∈ M.sets)
89
- (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets)
90
- (omega : ZFSet.omega ∈ M.sets) :
91
- ∃ output ∈ M.sets,
92
- Realize M.sets (refinementHistoryForcingOutputFormula 0 1 2 3 4 5)
93
- ![output, rows, T, stages, history, ZFSet.omega] ∧
94
- ∀ other ∈ M.sets,
95
- Realize M.sets (refinementHistoryForcingOutputFormula 0 1 2 3 4 5)
96
- ![other, rows, T, stages, history, ZFSet.omega] → other = output := by
97
- have ground := M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hStages hHistory omega
98
- have meaning (output : ZFSet.{u}) (hOutput : output ∈ M.sets) :
99
- Realize M.sets (refinementHistoryForcingOutputFormula 0 1 2 3 4 5)
100
- ![output, rows, T, stages, history, ZFSet.omega] ↔
101
- output = M.refinementHistoryForcing rows T stages history :=
102
- M.realize_refinementHistoryForcingOutputFormula pairing unions powers separation 0 1 2 3 4 5 _
103
- (Fin.cases hOutput (Fin.cases hRows (Fin.cases hT (Fin.cases hStages
104
- (Fin.cases hHistory (Fin.cases omega (fun j => Fin.elim0 j))))))) rfl
105
- exact ⟨_, ground, (meaning _ ground).2 rfl, fun other member valid => (meaning other member).1 valid⟩
106
-
107
- end TransitiveGround
108
- end PartitionPilot.Forcing
109
-
110
-
111
-
112
- namespace PartitionPilot.Forcing.TransitiveGround
113
- open SetFormula
114
- universe u
115
- variable (M : TransitiveGround.{u})
116
- variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
117
- variable (unions : Realize M.sets SetFormula.union Fin.elim0)
118
- variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
119
-
120
- noncomputable def refinementHistoryOrderOutputFormula {n : Nat}
121
- (output rows rowOrder T stages history N : Fin n) : SetFormula n :=
122
- .ex (.conj (refinementHistoryForcingOutputFormula 0 rows.succ T.succ stages.succ history.succ N.succ)
123
- (M.rawRowAssignmentOrderOutputFormula pairing unions powers separation output.succ 0 rowOrder.succ))
124
-
125
- theorem realize_refinementHistoryOrderOutputFormula {n : Nat}
126
- (output rows rowOrder T stages history N : Fin n) (env : Fin n → ZFSet.{u})
127
- (members : ∀ j, env j ∈ M.sets) (naturals : env N = ZFSet.omega) :
128
- Realize M.sets (M.refinementHistoryOrderOutputFormula pairing unions powers separation
129
- output rows rowOrder T stages history N) env ↔
130
- env output = M.refinementHistoryOrder (env rows) (env rowOrder) (env T) (env stages) (env history) := by
131
- unfold refinementHistoryOrderOutputFormula
132
- rw [realize_ex]
133
- have meaning (Q : ZFSet.{u}) (hQ : Q ∈ M.sets) :
134
- Realize M.sets (.conj
135
- (refinementHistoryForcingOutputFormula 0 rows.succ T.succ stages.succ history.succ N.succ)
136
- (M.rawRowAssignmentOrderOutputFormula pairing unions powers separation output.succ 0 rowOrder.succ))
137
- (extend Q env) ↔
138
- Q = M.refinementHistoryForcing (env rows) (env T) (env stages) (env history) ∧
139
- env output = rawRowAssignmentOrder Q (env rowOrder) :=
140
- and_congr (M.realize_refinementHistoryForcingOutputFormula pairing unions powers separation
141
- 0 rows.succ T.succ stages.succ history.succ N.succ (extend Q env) (Fin.cases hQ members) naturals)
142
- (M.realize_rawRowAssignmentOrderOutputFormula pairing unions powers separation
143
- output.succ 0 rowOrder.succ (extend Q env) (Fin.cases hQ members))
144
- constructor
145
- · rintro ⟨Q, hQ, recognized⟩
146
- obtain ⟨rfl, equal⟩ := (meaning Q hQ).1 recognized
147
- rw [M.refinementHistoryOrder_raw]
148
- exact equal
149
- · intro equal
150
- have ground := M.refinementHistoryForcing_mem pairing unions powers separation
151
- (members rows) (members T) (members stages) (members history) (naturals ▸ members N)
152
- refine ⟨_, ground, (meaning _ ground).2 ⟨rfl, ?_⟩⟩
153
- rw [M.refinementHistoryOrder_raw] at equal
154
- exact equal
155
-
156
- theorem exists_unique_refinementHistoryOrderOutput
157
- {rows rowOrder T stages history : ZFSet.{u}}
158
- (hRows : rows ∈ M.sets) (hOrder : rowOrder ∈ M.sets) (hT : T ∈ M.sets)
159
- (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) :
160
- ∃ output ∈ M.sets,
161
- Realize M.sets (M.refinementHistoryOrderOutputFormula pairing unions powers separation 0 1 2 3 4 5 6)
162
- ![output, rows, rowOrder, T, stages, history, ZFSet.omega] ∧
163
- ∀ other ∈ M.sets,
164
- Realize M.sets (M.refinementHistoryOrderOutputFormula pairing unions powers separation 0 1 2 3 4 5 6)
165
- ![other, rows, rowOrder, T, stages, history, ZFSet.omega] → other = output := by
166
- have ground := M.refinementHistoryOrder_mem pairing unions powers separation hRows hOrder hT hStages hHistory omega
167
- have meaning (output : ZFSet.{u}) (hOutput : output ∈ M.sets) :
168
- Realize M.sets (M.refinementHistoryOrderOutputFormula pairing unions powers separation 0 1 2 3 4 5 6)
169
- ![output, rows, rowOrder, T, stages, history, ZFSet.omega] ↔
170
- output = M.refinementHistoryOrder rows rowOrder T stages history :=
171
- M.realize_refinementHistoryOrderOutputFormula pairing unions powers separation 0 1 2 3 4 5 6 _
172
- (Fin.cases hOutput (Fin.cases hRows (Fin.cases hOrder (Fin.cases hT (Fin.cases hStages
173
- (Fin.cases hHistory (Fin.cases omega (fun j => Fin.elim0 j)))))))) rfl
174
- exact ⟨_, ground, (meaning _ ground).2 rfl, fun other member valid => (meaning other member).1 valid⟩
175
-
176
- end PartitionPilot.Forcing.TransitiveGround
177
-
178
- end
179
-
180
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Geometry.GroundDefinableRowAssignmentOrders
2
+ import OAI.SetTheory.PartitionPrinciple.Transfinite.GroundDefinableRefinementHistories
3
+
4
+ namespace OAI
5
+
6
+ section
7
+
8
+ namespace PartitionPilot.Forcing
9
+ open SetRealization SetFormula
10
+ universe u
11
+
12
+ namespace SetFormula
13
+
14
+ noncomputable def refinementHistoryForcingOutputFormula {n : Nat}
15
+ (output rows T stages history N : Fin n) : SetFormula n :=
16
+ let old := suffixIndex n 2
17
+ let v := prefixIndex n 2
18
+ exBlock 2 (.conj (refinementDataHistoryIndicesSetFormula (v 0) (old stages) (old history))
19
+ (.conj (refinementDataHistoryLevelsSetFormula (v 1) (old stages) (old history) (old T))
20
+ (forcingHistoryConditionsOutputFormula (old output) (old rows) (v 0) (old T)
21
+ (old stages) (old history) (v 1) (old N))))
22
+
23
+ end SetFormula
24
+
25
+ namespace TransitiveGround
26
+ variable (M : TransitiveGround.{u})
27
+ variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
28
+ variable (unions : Realize M.sets SetFormula.union Fin.elim0)
29
+ variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
30
+ include pairing unions powers separation
31
+
32
+ theorem realize_refinementHistoryForcingOutputFormula {n : Nat}
33
+ (output rows T stages history N : Fin n)
34
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets)
35
+ (naturals : env N = ZFSet.omega) :
36
+ Realize M.sets (refinementHistoryForcingOutputFormula output rows T stages history N) env ↔
37
+ env output = M.refinementHistoryForcing (env rows) (env T) (env stages) (env history) := by
38
+ rw [refinementHistoryForcingOutputFormula, realize_exBlock]
39
+ have actual (fields : Fin 2 → ZFSet.{u}) (ground : ∀ j, fields j ∈ M.sets) :
40
+ Realize M.sets (.conj
41
+ (refinementDataHistoryIndicesSetFormula (prefixIndex n 2 0)
42
+ (suffixIndex n 2 stages) (suffixIndex n 2 history))
43
+ (.conj (refinementDataHistoryLevelsSetFormula (prefixIndex n 2 1)
44
+ (suffixIndex n 2 stages) (suffixIndex n 2 history) (suffixIndex n 2 T))
45
+ (forcingHistoryConditionsOutputFormula (suffixIndex n 2 output) (suffixIndex n 2 rows)
46
+ (prefixIndex n 2 0) (suffixIndex n 2 T) (suffixIndex n 2 stages)
47
+ (suffixIndex n 2 history) (prefixIndex n 2 1) (suffixIndex n 2 N))))
48
+ (extendMany 2 fields env) ↔
49
+ fields 0 = refinementDataHistoryIndices (env stages) (env history) ∧
50
+ fields 1 = refinementDataHistoryLevels (env stages) (env history) (env T) ∧
51
+ env output = M.forcingHistoryConditions (env rows) (fields 0) (env T)
52
+ (env stages) (env history) (fields 1) := by
53
+ have bounds := extendMany_members 2 fields env ground members
54
+ apply and_congr
55
+ · simpa only [extendMany_prefix, extendMany_suffix] using
56
+ M.realize_refinementDataHistoryIndicesSetFormula pairing unions powers separation
57
+ (prefixIndex n 2 0) (suffixIndex n 2 stages) (suffixIndex n 2 history)
58
+ (extendMany 2 fields env) bounds
59
+ apply and_congr
60
+ · simpa only [extendMany_prefix, extendMany_suffix] using
61
+ M.realize_refinementDataHistoryLevelsSetFormula pairing unions powers separation
62
+ (prefixIndex n 2 1) (suffixIndex n 2 stages) (suffixIndex n 2 history) (suffixIndex n 2 T)
63
+ (extendMany 2 fields env) bounds
64
+ · simpa only [extendMany_prefix, extendMany_suffix] using
65
+ M.realize_forcingHistoryConditionsOutputFormula pairing separation
66
+ (suffixIndex n 2 output) (suffixIndex n 2 rows) (prefixIndex n 2 0)
67
+ (suffixIndex n 2 T) (suffixIndex n 2 stages) (suffixIndex n 2 history)
68
+ (prefixIndex n 2 1) (suffixIndex n 2 N) (extendMany 2 fields env) bounds
69
+ (by simpa only [extendMany_suffix] using naturals)
70
+ constructor
71
+ · rintro ⟨fields, ground, body⟩
72
+ obtain ⟨indices, levels, outputEq⟩ := (actual fields ground).1 body
73
+ rw [indices, levels] at outputEq
74
+ exact outputEq
75
+ · intro equal
76
+ let fields : Fin 2 → ZFSet.{u} :=
77
+ ![refinementDataHistoryIndices (env stages) (env history),
78
+ refinementDataHistoryLevels (env stages) (env history) (env T)]
79
+ have ground : ∀ j, fields j ∈ M.sets :=
80
+ Fin.cases (M.refinementDataHistoryIndices_mem pairing unions powers separation
81
+ (members stages) (members history))
82
+ (Fin.cases (M.refinementDataHistoryLevels_mem pairing unions powers separation
83
+ (members stages) (members history) (members T)) (fun j => Fin.elim0 j))
84
+ exact ⟨fields, ground, (actual fields ground).2 ⟨rfl, rfl, equal⟩⟩
85
+
86
+ theorem exists_unique_refinementHistoryForcingOutput
87
+ {rows T stages history : ZFSet.{u}}
88
+ (hRows : rows ∈ M.sets) (hT : T ∈ M.sets)
89
+ (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets)
90
+ (omega : ZFSet.omega ∈ M.sets) :
91
+ ∃ output ∈ M.sets,
92
+ Realize M.sets (refinementHistoryForcingOutputFormula 0 1 2 3 4 5)
93
+ ![output, rows, T, stages, history, ZFSet.omega] ∧
94
+ ∀ other ∈ M.sets,
95
+ Realize M.sets (refinementHistoryForcingOutputFormula 0 1 2 3 4 5)
96
+ ![other, rows, T, stages, history, ZFSet.omega] → other = output := by
97
+ have ground := M.refinementHistoryForcing_mem pairing unions powers separation hRows hT hStages hHistory omega
98
+ have meaning (output : ZFSet.{u}) (hOutput : output ∈ M.sets) :
99
+ Realize M.sets (refinementHistoryForcingOutputFormula 0 1 2 3 4 5)
100
+ ![output, rows, T, stages, history, ZFSet.omega] ↔
101
+ output = M.refinementHistoryForcing rows T stages history :=
102
+ M.realize_refinementHistoryForcingOutputFormula pairing unions powers separation 0 1 2 3 4 5 _
103
+ (Fin.cases hOutput (Fin.cases hRows (Fin.cases hT (Fin.cases hStages
104
+ (Fin.cases hHistory (Fin.cases omega (fun j => Fin.elim0 j))))))) rfl
105
+ exact ⟨_, ground, (meaning _ ground).2 rfl, fun other member valid => (meaning other member).1 valid⟩
106
+
107
+ end TransitiveGround
108
+ end PartitionPilot.Forcing
109
+
110
+
111
+
112
+ namespace PartitionPilot.Forcing.TransitiveGround
113
+ open SetFormula
114
+ universe u
115
+ variable (M : TransitiveGround.{u})
116
+ variable (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
117
+ variable (unions : Realize M.sets SetFormula.union Fin.elim0)
118
+ variable (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
119
+
120
+ noncomputable def refinementHistoryOrderOutputFormula {n : Nat}
121
+ (output rows rowOrder T stages history N : Fin n) : SetFormula n :=
122
+ .ex (.conj (refinementHistoryForcingOutputFormula 0 rows.succ T.succ stages.succ history.succ N.succ)
123
+ (M.rawRowAssignmentOrderOutputFormula pairing unions powers separation output.succ 0 rowOrder.succ))
124
+
125
+ theorem realize_refinementHistoryOrderOutputFormula {n : Nat}
126
+ (output rows rowOrder T stages history N : Fin n) (env : Fin n → ZFSet.{u})
127
+ (members : ∀ j, env j ∈ M.sets) (naturals : env N = ZFSet.omega) :
128
+ Realize M.sets (M.refinementHistoryOrderOutputFormula pairing unions powers separation
129
+ output rows rowOrder T stages history N) env ↔
130
+ env output = M.refinementHistoryOrder (env rows) (env rowOrder) (env T) (env stages) (env history) := by
131
+ unfold refinementHistoryOrderOutputFormula
132
+ rw [realize_ex]
133
+ have meaning (Q : ZFSet.{u}) (hQ : Q ∈ M.sets) :
134
+ Realize M.sets (.conj
135
+ (refinementHistoryForcingOutputFormula 0 rows.succ T.succ stages.succ history.succ N.succ)
136
+ (M.rawRowAssignmentOrderOutputFormula pairing unions powers separation output.succ 0 rowOrder.succ))
137
+ (extend Q env) ↔
138
+ Q = M.refinementHistoryForcing (env rows) (env T) (env stages) (env history) ∧
139
+ env output = rawRowAssignmentOrder Q (env rowOrder) :=
140
+ and_congr (M.realize_refinementHistoryForcingOutputFormula pairing unions powers separation
141
+ 0 rows.succ T.succ stages.succ history.succ N.succ (extend Q env) (Fin.cases hQ members) naturals)
142
+ (M.realize_rawRowAssignmentOrderOutputFormula pairing unions powers separation
143
+ output.succ 0 rowOrder.succ (extend Q env) (Fin.cases hQ members))
144
+ constructor
145
+ · rintro ⟨Q, hQ, recognized⟩
146
+ obtain ⟨rfl, equal⟩ := (meaning Q hQ).1 recognized
147
+ rw [M.refinementHistoryOrder_raw]
148
+ exact equal
149
+ · intro equal
150
+ have ground := M.refinementHistoryForcing_mem pairing unions powers separation
151
+ (members rows) (members T) (members stages) (members history) (naturals ▸ members N)
152
+ refine ⟨_, ground, (meaning _ ground).2 ⟨rfl, ?_⟩⟩
153
+ rw [M.refinementHistoryOrder_raw] at equal
154
+ exact equal
155
+
156
+ theorem exists_unique_refinementHistoryOrderOutput
157
+ {rows rowOrder T stages history : ZFSet.{u}}
158
+ (hRows : rows ∈ M.sets) (hOrder : rowOrder ∈ M.sets) (hT : T ∈ M.sets)
159
+ (hStages : stages ∈ M.sets) (hHistory : history ∈ M.sets) (omega : ZFSet.omega ∈ M.sets) :
160
+ ∃ output ∈ M.sets,
161
+ Realize M.sets (M.refinementHistoryOrderOutputFormula pairing unions powers separation 0 1 2 3 4 5 6)
162
+ ![output, rows, rowOrder, T, stages, history, ZFSet.omega] ∧
163
+ ∀ other ∈ M.sets,
164
+ Realize M.sets (M.refinementHistoryOrderOutputFormula pairing unions powers separation 0 1 2 3 4 5 6)
165
+ ![other, rows, rowOrder, T, stages, history, ZFSet.omega] → other = output := by
166
+ have ground := M.refinementHistoryOrder_mem pairing unions powers separation hRows hOrder hT hStages hHistory omega
167
+ have meaning (output : ZFSet.{u}) (hOutput : output ∈ M.sets) :
168
+ Realize M.sets (M.refinementHistoryOrderOutputFormula pairing unions powers separation 0 1 2 3 4 5 6)
169
+ ![output, rows, rowOrder, T, stages, history, ZFSet.omega] ↔
170
+ output = M.refinementHistoryOrder rows rowOrder T stages history :=
171
+ M.realize_refinementHistoryOrderOutputFormula pairing unions powers separation 0 1 2 3 4 5 6 _
172
+ (Fin.cases hOutput (Fin.cases hRows (Fin.cases hOrder (Fin.cases hT (Fin.cases hStages
173
+ (Fin.cases hHistory (Fin.cases omega (fun j => Fin.elim0 j)))))))) rfl
174
+ exact ⟨_, ground, (meaning _ ground).2 rfl, fun other member valid => (meaning other member).1 valid⟩
175
+
176
+ end PartitionPilot.Forcing.TransitiveGround
177
+
178
+ end
179
+
180
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementIndexActionFormulas.lean CHANGED
@@ -1,60 +1,60 @@
1
- import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProductActions
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
- open SetFormula
9
- universe u
10
- namespace SetFormula
11
-
12
- def refinementIndexActionRawFormula {n}
13
- (x y g P maps nodeMaps : Fin n) (w : Fin 13 → Fin n) : SetFormula n :=
14
- .conj (BoundedFormula.nonemptyTupleFormula 5 x (fun j => w (j.castAdd 7))).toFormula
15
- (.conj (BoundedFormula.nonemptyTupleFormula 5 y (fun j => w ((Fin.natAdd 6 j).castAdd 1))).toFormula
16
- (.conj (.equal (w 0) (w 6))
17
- (.conj (pairMembershipFormula g (w 12) nodeMaps)
18
- (.conj (pairMembershipFormula (w 1) (w 7) (w 12))
19
- (.conj (pairMembershipFormula (w 2) (w 8) (w 12))
20
- (.conj (atomicApplication nameActionFormula (extend P (extend maps Fin.elim0)) g (w 3) (w 9))
21
- (.conj (atomicApplication nameActionFormula (extend P (extend maps Fin.elim0)) g (w 4) (w 10))
22
- (atomicApplication nameActionFormula (extend P (extend maps Fin.elim0)) g (w 5) (w 11)))))))))
23
-
24
- def refinementIndexActionFormula {n} (x y g P maps nodeMaps : Fin n) : SetFormula n :=
25
- let old := suffixIndex n 13
26
- exBlock 13 (refinementIndexActionRawFormula (old x) (old y) (old g) (old P)
27
- (old maps) (old nodeMaps) (prefixIndex n 13))
28
-
29
- end SetFormula
30
-
31
- namespace TransitiveGround
32
- variable (M : TransitiveGround.{u})
33
-
34
- theorem realize_refinementIndexActionRawFormula
35
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
36
- {n} (x y g P maps nodeMaps : Fin n) (w : Fin 13 → Fin n)
37
- (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
38
- Realize M.sets (refinementIndexActionRawFormula x y g P maps nodeMaps w) env ↔
39
- env x = nonemptyTupleCode 5 (fun j => env (w (j.castAdd 7))) ∧
40
- env y = nonemptyTupleCode 5 (fun j => env (w ((Fin.natAdd 6 j).castAdd 1))) ∧
41
- env (w 0) = env (w 6) ∧ ZFSet.pair (env g) (env (w 12)) ∈ env nodeMaps ∧
42
- ZFSet.pair (env (w 1)) (env (w 7)) ∈ env (w 12) ∧
43
- ZFSet.pair (env (w 2)) (env (w 8)) ∈ env (w 12) ∧
44
- Realize M.sets nameActionFormula (extend (env g) (extend (env (w 3))
45
- (extend (env (w 9)) (extend (env P) (extend (env maps) Fin.elim0))))) ∧
46
- Realize M.sets nameActionFormula (extend (env g) (extend (env (w 4))
47
- (extend (env (w 10)) (extend (env P) (extend (env maps) Fin.elim0))))) ∧
48
- Realize M.sets nameActionFormula (extend (env g) (extend (env (w 5))
49
- (extend (env (w 11)) (extend (env P) (extend (env maps) Fin.elim0))))) := by
50
- simp only [refinementIndexActionRawFormula, Realize,
51
- BoundedFormula.realize_toFormula M _ env members, BoundedFormula.truth_nonemptyTupleFormula,
52
- M.realize_pairMembershipFormula pairing _ _ _ env (members _) (members _) (members _),
53
- realize_atomicApplication, map_extend, map_empty]
54
-
55
- end TransitiveGround
56
- end PartitionPilot.Forcing
57
-
58
- end
59
-
60
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProductActions
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+ open SetFormula
9
+ universe u
10
+ namespace SetFormula
11
+
12
+ def refinementIndexActionRawFormula {n}
13
+ (x y g P maps nodeMaps : Fin n) (w : Fin 13 → Fin n) : SetFormula n :=
14
+ .conj (BoundedFormula.nonemptyTupleFormula 5 x (fun j => w (j.castAdd 7))).toFormula
15
+ (.conj (BoundedFormula.nonemptyTupleFormula 5 y (fun j => w ((Fin.natAdd 6 j).castAdd 1))).toFormula
16
+ (.conj (.equal (w 0) (w 6))
17
+ (.conj (pairMembershipFormula g (w 12) nodeMaps)
18
+ (.conj (pairMembershipFormula (w 1) (w 7) (w 12))
19
+ (.conj (pairMembershipFormula (w 2) (w 8) (w 12))
20
+ (.conj (atomicApplication nameActionFormula (extend P (extend maps Fin.elim0)) g (w 3) (w 9))
21
+ (.conj (atomicApplication nameActionFormula (extend P (extend maps Fin.elim0)) g (w 4) (w 10))
22
+ (atomicApplication nameActionFormula (extend P (extend maps Fin.elim0)) g (w 5) (w 11)))))))))
23
+
24
+ def refinementIndexActionFormula {n} (x y g P maps nodeMaps : Fin n) : SetFormula n :=
25
+ let old := suffixIndex n 13
26
+ exBlock 13 (refinementIndexActionRawFormula (old x) (old y) (old g) (old P)
27
+ (old maps) (old nodeMaps) (prefixIndex n 13))
28
+
29
+ end SetFormula
30
+
31
+ namespace TransitiveGround
32
+ variable (M : TransitiveGround.{u})
33
+
34
+ theorem realize_refinementIndexActionRawFormula
35
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
36
+ {n} (x y g P maps nodeMaps : Fin n) (w : Fin 13 → Fin n)
37
+ (env : Fin n → ZFSet.{u}) (members : ∀ j, env j ∈ M.sets) :
38
+ Realize M.sets (refinementIndexActionRawFormula x y g P maps nodeMaps w) env ↔
39
+ env x = nonemptyTupleCode 5 (fun j => env (w (j.castAdd 7))) ∧
40
+ env y = nonemptyTupleCode 5 (fun j => env (w ((Fin.natAdd 6 j).castAdd 1))) ∧
41
+ env (w 0) = env (w 6) ∧ ZFSet.pair (env g) (env (w 12)) ∈ env nodeMaps ∧
42
+ ZFSet.pair (env (w 1)) (env (w 7)) ∈ env (w 12) ∧
43
+ ZFSet.pair (env (w 2)) (env (w 8)) ∈ env (w 12) ∧
44
+ Realize M.sets nameActionFormula (extend (env g) (extend (env (w 3))
45
+ (extend (env (w 9)) (extend (env P) (extend (env maps) Fin.elim0))))) ∧
46
+ Realize M.sets nameActionFormula (extend (env g) (extend (env (w 4))
47
+ (extend (env (w 10)) (extend (env P) (extend (env maps) Fin.elim0))))) ∧
48
+ Realize M.sets nameActionFormula (extend (env g) (extend (env (w 5))
49
+ (extend (env (w 11)) (extend (env P) (extend (env maps) Fin.elim0))))) := by
50
+ simp only [refinementIndexActionRawFormula, Realize,
51
+ BoundedFormula.realize_toFormula M _ env members, BoundedFormula.truth_nonemptyTupleFormula,
52
+ M.realize_pairMembershipFormula pairing _ _ _ env (members _) (members _) (members _),
53
+ realize_atomicApplication, map_extend, map_empty]
54
+
55
+ end TransitiveGround
56
+ end PartitionPilot.Forcing
57
+
58
+ end
59
+
60
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/RefinementValidityCodes.lean CHANGED
@@ -1,77 +1,77 @@
1
- import OAI.SetTheory.PartitionPrinciple.Models.GroundCountableQuotients
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
- universe u
9
-
10
- def RefinementValidityCode (T U Rf Rc : ZFSet.{u}) : Prop :=
11
- U ⊆ T ∧ EquivalenceRelationCode U Rf ∧ EquivalenceRelationCode U Rc ∧ Rf ⊆ Rc
12
-
13
- namespace BoundedFormula
14
- open SetFormula
15
-
16
- def equivalenceRelationFormula {n} (S R : Fin n) : BoundedFormula n :=
17
- .conj (relationBetweenFormula S S R)
18
- (.conj (.allMem S (pairMembershipFormula 0 0 R.succ))
19
- (.conj
20
- (.allMem S (.allMem S.succ
21
- (imp (pairMembershipFormula 1 0 R.succ.succ)
22
- (pairMembershipFormula 0 1 R.succ.succ))))
23
- (.allMem S (.allMem S.succ (.allMem S.succ.succ
24
- (imp (.conj (pairMembershipFormula 2 1 R.succ.succ.succ)
25
- (pairMembershipFormula 1 0 R.succ.succ.succ))
26
- (pairMembershipFormula 2 0 R.succ.succ.succ)))))))
27
-
28
- theorem truth_equivalenceRelationFormula {n} (S R : Fin n) (env : Fin n → ZFSet.{u}) :
29
- Truth (equivalenceRelationFormula S R) env ↔ EquivalenceRelationCode (env S) (env R) := by
30
- simp only [equivalenceRelationFormula, Truth, truth_relationBetweenFormula,
31
- truth_pairMembershipFormula, truth_imp]
32
- constructor
33
- · rintro ⟨shape, refl, symm, trans⟩
34
- refine ⟨shape, refl, ?_, ?_⟩
35
- · intro x y xy
36
- obtain ⟨hx, hy⟩ := ZFSet.pair_mem_prod.1 (shape xy)
37
- exact symm x hx y hy xy
38
- · intro x y z xy yz
39
- obtain ⟨hx, hy⟩ := ZFSet.pair_mem_prod.1 (shape xy)
40
- have hz := (ZFSet.pair_mem_prod.1 (shape yz)).2
41
- exact trans x hx y hy z hz ⟨xy, yz⟩
42
- · intro relation
43
- exact ⟨relation.shape, relation.refl,
44
- fun x _ y _ xy => relation.symm x y xy,
45
- fun x _ y _ z _ h => relation.trans x y z h.1 h.2⟩
46
-
47
- def refinementValidityFormula : BoundedFormula 4 :=
48
- .conj (subsetFormula 0 3)
49
- (.conj (equivalenceRelationFormula 0 1)
50
- (.conj (equivalenceRelationFormula 0 2) (subsetFormula 1 2)))
51
-
52
- theorem truth_refinementValidityFormula (env : Fin 4 → ZFSet.{u}) :
53
- Truth refinementValidityFormula env ↔
54
- RefinementValidityCode (env 3) (env 0) (env 1) (env 2) := by
55
- simp only [refinementValidityFormula, Truth, truth_subsetFormula,
56
- truth_equivalenceRelationFormula, RefinementValidityCode]
57
-
58
- end BoundedFormula
59
-
60
- namespace TransitiveGround
61
- open SetFormula
62
- variable (M : TransitiveGround.{u})
63
-
64
- theorem realize_refinementValidityFormula (env : Fin 4 → ZFSet.{u})
65
- (members : ∀ i, env i ∈ M.sets) :
66
- Realize M.sets BoundedFormula.refinementValidityFormula.toFormula env ↔
67
- RefinementValidityCode (env 3) (env 0) (env 1) (env 2) :=
68
- (BoundedFormula.realize_toFormula M _ _ members).trans
69
- (BoundedFormula.truth_refinementValidityFormula env)
70
-
71
- end TransitiveGround
72
-
73
- end PartitionPilot.Forcing
74
-
75
- end
76
-
77
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Models.GroundCountableQuotients
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+ universe u
9
+
10
+ def RefinementValidityCode (T U Rf Rc : ZFSet.{u}) : Prop :=
11
+ U ⊆ T ∧ EquivalenceRelationCode U Rf ∧ EquivalenceRelationCode U Rc ∧ Rf ⊆ Rc
12
+
13
+ namespace BoundedFormula
14
+ open SetFormula
15
+
16
+ def equivalenceRelationFormula {n} (S R : Fin n) : BoundedFormula n :=
17
+ .conj (relationBetweenFormula S S R)
18
+ (.conj (.allMem S (pairMembershipFormula 0 0 R.succ))
19
+ (.conj
20
+ (.allMem S (.allMem S.succ
21
+ (imp (pairMembershipFormula 1 0 R.succ.succ)
22
+ (pairMembershipFormula 0 1 R.succ.succ))))
23
+ (.allMem S (.allMem S.succ (.allMem S.succ.succ
24
+ (imp (.conj (pairMembershipFormula 2 1 R.succ.succ.succ)
25
+ (pairMembershipFormula 1 0 R.succ.succ.succ))
26
+ (pairMembershipFormula 2 0 R.succ.succ.succ)))))))
27
+
28
+ theorem truth_equivalenceRelationFormula {n} (S R : Fin n) (env : Fin n → ZFSet.{u}) :
29
+ Truth (equivalenceRelationFormula S R) env ↔ EquivalenceRelationCode (env S) (env R) := by
30
+ simp only [equivalenceRelationFormula, Truth, truth_relationBetweenFormula,
31
+ truth_pairMembershipFormula, truth_imp]
32
+ constructor
33
+ · rintro ⟨shape, refl, symm, trans⟩
34
+ refine ⟨shape, refl, ?_, ?_⟩
35
+ · intro x y xy
36
+ obtain ⟨hx, hy⟩ := ZFSet.pair_mem_prod.1 (shape xy)
37
+ exact symm x hx y hy xy
38
+ · intro x y z xy yz
39
+ obtain ⟨hx, hy⟩ := ZFSet.pair_mem_prod.1 (shape xy)
40
+ have hz := (ZFSet.pair_mem_prod.1 (shape yz)).2
41
+ exact trans x hx y hy z hz ⟨xy, yz⟩
42
+ · intro relation
43
+ exact ⟨relation.shape, relation.refl,
44
+ fun x _ y _ xy => relation.symm x y xy,
45
+ fun x _ y _ z _ h => relation.trans x y z h.1 h.2⟩
46
+
47
+ def refinementValidityFormula : BoundedFormula 4 :=
48
+ .conj (subsetFormula 0 3)
49
+ (.conj (equivalenceRelationFormula 0 1)
50
+ (.conj (equivalenceRelationFormula 0 2) (subsetFormula 1 2)))
51
+
52
+ theorem truth_refinementValidityFormula (env : Fin 4 → ZFSet.{u}) :
53
+ Truth refinementValidityFormula env ↔
54
+ RefinementValidityCode (env 3) (env 0) (env 1) (env 2) := by
55
+ simp only [refinementValidityFormula, Truth, truth_subsetFormula,
56
+ truth_equivalenceRelationFormula, RefinementValidityCode]
57
+
58
+ end BoundedFormula
59
+
60
+ namespace TransitiveGround
61
+ open SetFormula
62
+ variable (M : TransitiveGround.{u})
63
+
64
+ theorem realize_refinementValidityFormula (env : Fin 4 → ZFSet.{u})
65
+ (members : ∀ i, env i ∈ M.sets) :
66
+ Realize M.sets BoundedFormula.refinementValidityFormula.toFormula env ↔
67
+ RefinementValidityCode (env 3) (env 0) (env 1) (env 2) :=
68
+ (BoundedFormula.realize_toFormula M _ _ members).trans
69
+ (BoundedFormula.truth_refinementValidityFormula env)
70
+
71
+ end TransitiveGround
72
+
73
+ end PartitionPilot.Forcing
74
+
75
+ end
76
+
77
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/RenamedEntryFormulas.lean CHANGED
@@ -1,137 +1,137 @@
1
- import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProductActions
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing.SetFormula
8
-
9
- def renamedChildFormula : SetFormula 4 :=
10
- ex (exConditions 3 (.conj (orderedPairFormula 2 1 0)
11
- (.conj (domainApplication uniformNameFormula (extend 4 Fin.elim0) 3)
12
- (binaryApplication uniformRenameFormula (extend 4 (extend 5 Fin.elim0)) 1 3))))
13
-
14
- def renamedEntryFormula : SetFormula 4 :=
15
- ex (exConditions 3 (.conj (pairMembershipFormula 1 0 3)
16
- (ex (exConditions 5 (.conj (orderedPairFormula 4 1 0)
17
- (.conj (pairMembershipFormula 2 0 7)
18
- (.conj (domainApplication uniformNameFormula (extend 6 Fin.elim0) 1)
19
- (binaryApplication uniformRenameFormula (extend 6 (extend 7 Fin.elim0)) 3 1))))))))
20
-
21
- end PartitionPilot.Forcing.SetFormula
22
-
23
- namespace PartitionPilot.Forcing.TransitiveGround
24
-
25
- open SetRealization SetFormula
26
- universe u
27
- variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P)
28
-
29
- theorem realize_renamedChildFormula
30
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
31
- (unions : Realize M.sets SetFormula.union Fin.elim0)
32
- (powers : Realize M.sets powerSet Fin.elim0)
33
- (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets)
34
- (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets)
35
- (σ : Name s) (hσ : σ.val ∈ M.sets) (p : P) (y : ZFSet.{u}) (hy : y ∈ M.sets) :
36
- Realize M.sets renamedChildFormula
37
- (extend (ZFSet.pair σ.val (s.encode p)) (extend y (renameParameters s f))) ↔
38
- y = (Name.rename s f σ).val := by
39
- let base := extend (ZFSet.pair σ.val (s.encode p)) (extend y (renameParameters s f))
40
- have hp := M.transitive carrier (s.encode_mem p)
41
- have hz := M.orderedPair_mem pairing hσ hp
42
- rw [renamedChildFormula, realize_ex]
43
- constructor
44
- · rintro ⟨x, hx, rest⟩
45
- obtain ⟨r, shape, name, renamed⟩ := (M.realize_exConditions s 3 _ (extend x base) carrier rfl).1 rest
46
- let e := extend (s.encode r) (extend x base)
47
- have raw := (M.realize_orderedPairFormula pairing 2 1 0 e hz hx
48
- (M.transitive carrier (s.encode_mem r))).1 shape
49
- change ZFSet.pair σ.val (s.encode p) = ZFSet.pair x (s.encode r) at raw
50
- obtain ⟨sx, pr⟩ := ZFSet.pair_inj.1 raw
51
- have cond := s.injective pr
52
- subst x
53
- subst r
54
- rw [realize_domainApplication, map_extend, map_empty] at name
55
- have nameY := (M.realize_uniformNameFormula s pairing unions powers separation collection carrier y hy).1 name
56
- rw [realize_binaryApplication, map_extend, map_extend, map_empty] at renamed
57
- have eq := (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier f graph
58
- σ ⟨y, nameY⟩ hσ hy).1 renamed
59
- exact (congrArg Subtype.val eq).symm
60
- · intro eq
61
- subst y
62
- refine ⟨σ.val, hσ, ?_⟩
63
- apply (M.realize_exConditions s 3 _ (extend σ.val base) carrier rfl).2
64
- refine ⟨p, ?_, ?_, ?_⟩
65
- · exact (M.realize_orderedPairFormula pairing 2 1 0 _ hz hσ hp).2 rfl
66
- · rw [realize_domainApplication, map_extend, map_empty]
67
- exact (M.realize_uniformNameFormula s pairing unions powers separation collection carrier _ hy).2
68
- (Name.rename s f σ).property
69
- · rw [realize_binaryApplication, map_extend, map_extend, map_empty]
70
- exact (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier f graph
71
- σ (Name.rename s f σ) hσ hy).2 rfl
72
-
73
- theorem realize_renamedEntryFormula
74
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
75
- (unions : Realize M.sets SetFormula.union Fin.elim0)
76
- (powers : Realize M.sets powerSet Fin.elim0)
77
- (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets)
78
- (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets)
79
- (τ : Name s) (hτ : τ.val ∈ M.sets) (z : ZFSet.{u}) (hz : z ∈ M.sets) :
80
- Realize M.sets renamedEntryFormula (extend z (extend τ.val (renameParameters s f))) ↔
81
- z ∈ (Name.rename s f τ).val := by
82
- let base := extend z (extend τ.val (renameParameters s f))
83
- rw [renamedEntryFormula, realize_ex]
84
- constructor
85
- · rintro ⟨x, hx, rest⟩
86
- obtain ⟨p, old, rest⟩ := (M.realize_exConditions s 3 _ (extend x base) carrier rfl).1 rest
87
- have entry := (M.realize_pairMembershipFormula pairing 1 0 3
88
- (extend (s.encode p) (extend x base)) hx (M.transitive carrier (s.encode_mem p)) hτ).1 old
89
- let σ : Name s := ⟨x, Name.isName_of_pair_mem τ x p entry⟩
90
- obtain ⟨y, hy, rest⟩ := (realize_ex M.sets _ _).1 rest
91
- obtain ⟨q, shape, condition, name, renamed⟩ := (M.realize_exConditions s 5 _
92
- (extend y (extend (s.encode p) (extend x base))) carrier rfl).1 rest
93
- let e := extend (s.encode q) (extend y (extend (s.encode p) (extend x base)))
94
- have raw := (M.realize_orderedPairFormula pairing 4 1 0 e hz hy
95
- (M.transitive carrier (s.encode_mem q))).1 shape
96
- have cond := (M.realize_pairMembershipFormula pairing 2 0 7 e
97
- (M.transitive carrier (s.encode_mem p)) (M.transitive carrier (s.encode_mem q)) graph).1 condition
98
- have pq := (s.pair_mem_graph s f p q).1 cond
99
- rw [realize_domainApplication, map_extend, map_empty] at name
100
- have nameY := (M.realize_uniformNameFormula s pairing unions powers separation collection carrier y hy).1 name
101
- let ν : Name s := ⟨y, nameY⟩
102
- rw [realize_binaryApplication, map_extend, map_extend, map_empty] at renamed
103
- have eq := (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier f graph σ ν hx hy).1 renamed
104
- have member := (Name.entry_rename s f τ ν q).2 ⟨σ, p, entry, eq, pq⟩
105
- change z = ZFSet.pair y (s.encode q) at raw
106
- rw [raw]
107
- exact member
108
- · intro member
109
- obtain ⟨ν, q, rfl⟩ := Name.entries_cover (Name.rename s f τ) member
110
- obtain ⟨σ, p, entry, image, cond⟩ := (Name.entry_rename s f τ ν q).1 member
111
- have hσ := (M.nameDomain s).children hτ entry
112
- have hν := M.pair_left hz
113
- refine ⟨σ.val, hσ, ?_⟩
114
- apply (M.realize_exConditions s 3 _ (extend σ.val base) carrier rfl).2
115
- refine ⟨p, ?_, ?_⟩
116
- · exact (M.realize_pairMembershipFormula pairing 1 0 3 _ hσ
117
- (M.transitive carrier (s.encode_mem p)) hτ).2 entry
118
- · rw [realize_ex]
119
- refine ⟨ν.val, hν, ?_⟩
120
- apply (M.realize_exConditions s 5 _ (extend ν.val (extend (s.encode p) (extend σ.val base))) carrier rfl).2
121
- let e := extend (s.encode q) (extend ν.val (extend (s.encode p) (extend σ.val base)))
122
- refine ⟨q, ?_, ?_, ?_, ?_⟩
123
- · exact (M.realize_orderedPairFormula pairing 4 1 0 e hz hν
124
- (M.transitive carrier (s.encode_mem q))).2 rfl
125
- · exact (M.realize_pairMembershipFormula pairing 2 0 7 e
126
- (M.transitive carrier (s.encode_mem p)) (M.transitive carrier (s.encode_mem q)) graph).2
127
- ((s.pair_mem_graph s f p q).2 cond)
128
- · rw [realize_domainApplication, map_extend, map_empty]
129
- exact (M.realize_uniformNameFormula s pairing unions powers separation collection carrier ν.val hν).2 ν.property
130
- · rw [realize_binaryApplication, map_extend, map_extend, map_empty]
131
- exact (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier f graph σ ν hσ hν).2 image
132
-
133
- end PartitionPilot.Forcing.TransitiveGround
134
-
135
- end
136
-
137
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Forcing.GroundProductActions
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing.SetFormula
8
+
9
+ def renamedChildFormula : SetFormula 4 :=
10
+ ex (exConditions 3 (.conj (orderedPairFormula 2 1 0)
11
+ (.conj (domainApplication uniformNameFormula (extend 4 Fin.elim0) 3)
12
+ (binaryApplication uniformRenameFormula (extend 4 (extend 5 Fin.elim0)) 1 3))))
13
+
14
+ def renamedEntryFormula : SetFormula 4 :=
15
+ ex (exConditions 3 (.conj (pairMembershipFormula 1 0 3)
16
+ (ex (exConditions 5 (.conj (orderedPairFormula 4 1 0)
17
+ (.conj (pairMembershipFormula 2 0 7)
18
+ (.conj (domainApplication uniformNameFormula (extend 6 Fin.elim0) 1)
19
+ (binaryApplication uniformRenameFormula (extend 6 (extend 7 Fin.elim0)) 3 1))))))))
20
+
21
+ end PartitionPilot.Forcing.SetFormula
22
+
23
+ namespace PartitionPilot.Forcing.TransitiveGround
24
+
25
+ open SetRealization SetFormula
26
+ universe u
27
+ variable (M : TransitiveGround.{u}) {P : Type u} (s : Presentation P)
28
+
29
+ theorem realize_renamedChildFormula
30
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
31
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
32
+ (powers : Realize M.sets powerSet Fin.elim0)
33
+ (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets)
34
+ (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets)
35
+ (σ : Name s) (hσ : σ.val ∈ M.sets) (p : P) (y : ZFSet.{u}) (hy : y ∈ M.sets) :
36
+ Realize M.sets renamedChildFormula
37
+ (extend (ZFSet.pair σ.val (s.encode p)) (extend y (renameParameters s f))) ↔
38
+ y = (Name.rename s f σ).val := by
39
+ let base := extend (ZFSet.pair σ.val (s.encode p)) (extend y (renameParameters s f))
40
+ have hp := M.transitive carrier (s.encode_mem p)
41
+ have hz := M.orderedPair_mem pairing hσ hp
42
+ rw [renamedChildFormula, realize_ex]
43
+ constructor
44
+ · rintro ⟨x, hx, rest⟩
45
+ obtain ⟨r, shape, name, renamed⟩ := (M.realize_exConditions s 3 _ (extend x base) carrier rfl).1 rest
46
+ let e := extend (s.encode r) (extend x base)
47
+ have raw := (M.realize_orderedPairFormula pairing 2 1 0 e hz hx
48
+ (M.transitive carrier (s.encode_mem r))).1 shape
49
+ change ZFSet.pair σ.val (s.encode p) = ZFSet.pair x (s.encode r) at raw
50
+ obtain ⟨sx, pr⟩ := ZFSet.pair_inj.1 raw
51
+ have cond := s.injective pr
52
+ subst x
53
+ subst r
54
+ rw [realize_domainApplication, map_extend, map_empty] at name
55
+ have nameY := (M.realize_uniformNameFormula s pairing unions powers separation collection carrier y hy).1 name
56
+ rw [realize_binaryApplication, map_extend, map_extend, map_empty] at renamed
57
+ have eq := (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier f graph
58
+ σ ⟨y, nameY⟩ hσ hy).1 renamed
59
+ exact (congrArg Subtype.val eq).symm
60
+ · intro eq
61
+ subst y
62
+ refine ⟨σ.val, hσ, ?_⟩
63
+ apply (M.realize_exConditions s 3 _ (extend σ.val base) carrier rfl).2
64
+ refine ⟨p, ?_, ?_, ?_⟩
65
+ · exact (M.realize_orderedPairFormula pairing 2 1 0 _ hz hσ hp).2 rfl
66
+ · rw [realize_domainApplication, map_extend, map_empty]
67
+ exact (M.realize_uniformNameFormula s pairing unions powers separation collection carrier _ hy).2
68
+ (Name.rename s f σ).property
69
+ · rw [realize_binaryApplication, map_extend, map_extend, map_empty]
70
+ exact (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier f graph
71
+ σ (Name.rename s f σ) hσ hy).2 rfl
72
+
73
+ theorem realize_renamedEntryFormula
74
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
75
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
76
+ (powers : Realize M.sets powerSet Fin.elim0)
77
+ (separation : SeparationSchema M.sets) (collection : CollectionSchema M.sets)
78
+ (carrier : s.carrier ∈ M.sets) (f : P → P) (graph : s.graph s f ∈ M.sets)
79
+ (τ : Name s) (hτ : τ.val ∈ M.sets) (z : ZFSet.{u}) (hz : z ∈ M.sets) :
80
+ Realize M.sets renamedEntryFormula (extend z (extend τ.val (renameParameters s f))) ↔
81
+ z ∈ (Name.rename s f τ).val := by
82
+ let base := extend z (extend τ.val (renameParameters s f))
83
+ rw [renamedEntryFormula, realize_ex]
84
+ constructor
85
+ · rintro ⟨x, hx, rest⟩
86
+ obtain ⟨p, old, rest⟩ := (M.realize_exConditions s 3 _ (extend x base) carrier rfl).1 rest
87
+ have entry := (M.realize_pairMembershipFormula pairing 1 0 3
88
+ (extend (s.encode p) (extend x base)) hx (M.transitive carrier (s.encode_mem p)) hτ).1 old
89
+ let σ : Name s := ⟨x, Name.isName_of_pair_mem τ x p entry⟩
90
+ obtain ⟨y, hy, rest⟩ := (realize_ex M.sets _ _).1 rest
91
+ obtain ⟨q, shape, condition, name, renamed⟩ := (M.realize_exConditions s 5 _
92
+ (extend y (extend (s.encode p) (extend x base))) carrier rfl).1 rest
93
+ let e := extend (s.encode q) (extend y (extend (s.encode p) (extend x base)))
94
+ have raw := (M.realize_orderedPairFormula pairing 4 1 0 e hz hy
95
+ (M.transitive carrier (s.encode_mem q))).1 shape
96
+ have cond := (M.realize_pairMembershipFormula pairing 2 0 7 e
97
+ (M.transitive carrier (s.encode_mem p)) (M.transitive carrier (s.encode_mem q)) graph).1 condition
98
+ have pq := (s.pair_mem_graph s f p q).1 cond
99
+ rw [realize_domainApplication, map_extend, map_empty] at name
100
+ have nameY := (M.realize_uniformNameFormula s pairing unions powers separation collection carrier y hy).1 name
101
+ let ν : Name s := ⟨y, nameY⟩
102
+ rw [realize_binaryApplication, map_extend, map_extend, map_empty] at renamed
103
+ have eq := (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier f graph σ ν hx hy).1 renamed
104
+ have member := (Name.entry_rename s f τ ν q).2 ⟨σ, p, entry, eq, pq⟩
105
+ change z = ZFSet.pair y (s.encode q) at raw
106
+ rw [raw]
107
+ exact member
108
+ · intro member
109
+ obtain ⟨ν, q, rfl⟩ := Name.entries_cover (Name.rename s f τ) member
110
+ obtain ⟨σ, p, entry, image, cond⟩ := (Name.entry_rename s f τ ν q).1 member
111
+ have hσ := (M.nameDomain s).children hτ entry
112
+ have hν := M.pair_left hz
113
+ refine ⟨σ.val, hσ, ?_⟩
114
+ apply (M.realize_exConditions s 3 _ (extend σ.val base) carrier rfl).2
115
+ refine ⟨p, ?_, ?_⟩
116
+ · exact (M.realize_pairMembershipFormula pairing 1 0 3 _ hσ
117
+ (M.transitive carrier (s.encode_mem p)) hτ).2 entry
118
+ · rw [realize_ex]
119
+ refine ⟨ν.val, hν, ?_⟩
120
+ apply (M.realize_exConditions s 5 _ (extend ν.val (extend (s.encode p) (extend σ.val base))) carrier rfl).2
121
+ let e := extend (s.encode q) (extend ν.val (extend (s.encode p) (extend σ.val base)))
122
+ refine ⟨q, ?_, ?_, ?_, ?_⟩
123
+ · exact (M.realize_orderedPairFormula pairing 4 1 0 e hz hν
124
+ (M.transitive carrier (s.encode_mem q))).2 rfl
125
+ · exact (M.realize_pairMembershipFormula pairing 2 0 7 e
126
+ (M.transitive carrier (s.encode_mem p)) (M.transitive carrier (s.encode_mem q)) graph).2
127
+ ((s.pair_mem_graph s f p q).2 cond)
128
+ · rw [realize_domainApplication, map_extend, map_empty]
129
+ exact (M.realize_uniformNameFormula s pairing unions powers separation collection carrier ν.val hν).2 ν.property
130
+ · rw [realize_binaryApplication, map_extend, map_extend, map_empty]
131
+ exact (M.realize_uniformRenameFormula s pairing unions powers separation collection carrier f graph σ ν hσ hν).2 image
132
+
133
+ end PartitionPilot.Forcing.TransitiveGround
134
+
135
+ end
136
+
137
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/RepresentativeProductAgreement.lean CHANGED
@@ -1,120 +1,120 @@
1
- import OAI.SetTheory.PartitionPrinciple.Geometry.InitialRepresentativeAgreement
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
-
9
- universe u
10
-
11
- theorem TaskRepresentative.source_mem
12
- {P r A R U Labels I i g a : ZFSet.{u}}
13
- (represented : TaskRepresentative P r A R U Labels i g)
14
- (source : ZFSet.pair i a ∈ literalTaskSourceGraph I P R U Labels) : a ∈ P := by
15
- obtain ⟨a', ha, c, hc, base, hb, s, hs, F, hF, label, hl, equal, _⟩ := represented
16
- have aEq : a = a' :=
17
- ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).1 (equal ▸ source)).2
18
- exact aEq.symm ▸ ha
19
-
20
- theorem TaskTransportCode.representative_product_agreement
21
- {P R U Labels A δ i j G m one r g h k I a : ZFSet.{u}}
22
- (transport : TaskTransportCode P R U Labels A δ i j)
23
- (action : PosetActionCode G P m one r A)
24
- (hδ : δ ∈ G) (hg : g ∈ G) (hk : k ∈ G)
25
- (product : ZFSet.pair (ZFSet.pair δ g) k ∈ m)
26
- (first : TaskRepresentative P r A R U Labels i g)
27
- (second : TaskRepresentative P r A R U Labels j h)
28
- (source : ZFSet.pair i a ∈ literalTaskSourceGraph I P R U Labels) :
29
- ActionAgreementBelow P r A k h a := by
30
- obtain ⟨a', ha, c, hc, base, hb, s, hs, F, hF, label, hl,
31
- c', _, base', _, s', _, F', _, old, new, target, _, baseEq, _⟩ := transport
32
- have aEq : a = a' :=
33
- ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).1 (old ▸ source)).2
34
- have oldRestriction := (old ▸ first).restriction
35
- have newRestriction := (new ▸ second).restriction
36
- have composed := oldRestriction.transport action hg hδ hk product target
37
- rw [baseEq] at newRestriction
38
- intro x hx y _ lower
39
- exact (composed.base_action_iff action hx (aEq ▸ lower)).symm.trans
40
- (newRestriction.base_action_iff action hx (aEq ▸ lower))
41
-
42
- namespace TransitiveGround
43
-
44
- open SetFormula
45
- variable (M : TransitiveGround.{u})
46
-
47
- theorem groundTaskRepresentatives_product_agreement
48
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
49
- (unions : Realize M.sets SetFormula.union Fin.elim0)
50
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
51
- {P G r μ A Labels m inv one Reps δ i j g h k a : ZFSet.{u}}
52
- (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets)
53
- (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A)
54
- (meet : MeetOrderCode P r μ)
55
- (reps : ZFSet.IsFunc (M.groundEligibleTasks P G r μ A Labels) G Reps)
56
- (represents : ∀ i g, ZFSet.pair i g ∈ Reps →
57
- TaskRepresentative P r A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels i g)
58
- (task : ZFSet.pair (ZFSet.pair δ i) j ∈ M.groundTaskTransport P G r μ A Labels)
59
- (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels)
60
- P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels)
61
- (first : ZFSet.pair i g ∈ Reps) (second : ZFSet.pair j h ∈ Reps)
62
- (product : ZFSet.pair (ZFSet.pair δ g) k ∈ m) :
63
- let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet
64
- ActionAgreementBelow d.batchCarrier d.batchOrder
65
- (M.groundEligibleBatchAction P G r μ A Labels) k h a := by
66
- have transported := (triple_mem_taskTransportGraph G _ P _ _ Labels A δ i j).1 task
67
- have hg := (ZFSet.pair_mem_prod.1 (reps.1 first)).2
68
- have hh := (ZFSet.pair_mem_prod.1 (reps.1 second)).2
69
- have hk := (ZFSet.pair_mem_prod.1 (group.mul_function.1 product)).2
70
- have old := transported.2.2.2.representative_product_agreement action transported.1 hg hk
71
- product (represents i g first) (represents j h second) source
72
- exact M.groundEligibleBatchAction_agreement pairing unions powers separation hP hG hA
73
- group action meet hk hh ((represents i g first).source_mem source) old
74
-
75
- theorem groundTaskRepresentatives_composed_entry
76
- (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
77
- (unions : Realize M.sets SetFormula.union Fin.elim0)
78
- (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
79
- {P G r μ A Labels m inv one Reps δ i j g h a x y z : ZFSet.{u}}
80
- (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets)
81
- (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A)
82
- (meet : MeetOrderCode P r μ)
83
- (reps : ZFSet.IsFunc (M.groundEligibleTasks P G r μ A Labels) G Reps)
84
- (represents : ∀ i g, ZFSet.pair i g ∈ Reps →
85
- TaskRepresentative P r A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels i g)
86
- (task : ZFSet.pair (ZFSet.pair δ i) j ∈ M.groundTaskTransport P G r μ A Labels)
87
- (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels)
88
- P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels)
89
- (first : ZFSet.pair i g ∈ Reps) (second : ZFSet.pair j h ∈ Reps)
90
- (hx : x ∈ (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batchCarrier)
91
- (lower : ZFSet.pair x a ∈
92
- (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batchOrder)
93
- (firstAction : ZFSet.pair (ZFSet.pair g x) y ∈ M.groundEligibleBatchAction P G r μ A Labels)
94
- (secondAction : ZFSet.pair (ZFSet.pair h x) z ∈ M.groundEligibleBatchAction P G r μ A Labels) :
95
- ZFSet.pair (ZFSet.pair δ y) z ∈ M.groundEligibleBatchAction P G r μ A Labels := by
96
- have transported := (triple_mem_taskTransportGraph G _ P _ _ Labels A δ i j).1 task
97
- have hg := (ZFSet.pair_mem_prod.1 (reps.1 first)).2
98
- have hh := (ZFSet.pair_mem_prod.1 (reps.1 second)).2
99
- obtain ⟨k, product, _⟩ := group.mul_function.2 (ZFSet.pair δ g)
100
- (ZFSet.pair_mem_prod.2 ⟨transported.1, hg⟩)
101
- have hk := (ZFSet.pair_mem_prod.1 (group.mul_function.1 product)).2
102
- have agree := M.groundTaskRepresentatives_product_agreement pairing unions powers separation
103
- hP hG hA group action meet reps represents task source first second product
104
- have full := M.groundEligibleBatchAction_code (Labels := Labels)
105
- pairing unions powers separation hP hG hA group action meet
106
- have hy := (ZFSet.pair_mem_prod.1 (full.function.1 firstAction)).2
107
- obtain ⟨w, acted, _⟩ := full.function.2 (ZFSet.pair δ y)
108
- (ZFSet.pair_mem_prod.2 ⟨transported.1, hy⟩)
109
- have hw := (ZFSet.pair_mem_prod.1 (full.function.1 acted)).2
110
- have composed := full.mul δ transported.1 g hg k hk x hx y hy w hw product firstAction acted
111
- have equal := agree.entry_eq full hh hx lower composed secondAction
112
- exact equal ▸ acted
113
-
114
- end TransitiveGround
115
-
116
- end PartitionPilot.Forcing
117
-
118
- end
119
-
120
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Geometry.InitialRepresentativeAgreement
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+
9
+ universe u
10
+
11
+ theorem TaskRepresentative.source_mem
12
+ {P r A R U Labels I i g a : ZFSet.{u}}
13
+ (represented : TaskRepresentative P r A R U Labels i g)
14
+ (source : ZFSet.pair i a ∈ literalTaskSourceGraph I P R U Labels) : a ∈ P := by
15
+ obtain ⟨a', ha, c, hc, base, hb, s, hs, F, hF, label, hl, equal, _⟩ := represented
16
+ have aEq : a = a' :=
17
+ ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).1 (equal ▸ source)).2
18
+ exact aEq.symm ▸ ha
19
+
20
+ theorem TaskTransportCode.representative_product_agreement
21
+ {P R U Labels A δ i j G m one r g h k I a : ZFSet.{u}}
22
+ (transport : TaskTransportCode P R U Labels A δ i j)
23
+ (action : PosetActionCode G P m one r A)
24
+ (hδ : δ ∈ G) (hg : g ∈ G) (hk : k ∈ G)
25
+ (product : ZFSet.pair (ZFSet.pair δ g) k ∈ m)
26
+ (first : TaskRepresentative P r A R U Labels i g)
27
+ (second : TaskRepresentative P r A R U Labels j h)
28
+ (source : ZFSet.pair i a ∈ literalTaskSourceGraph I P R U Labels) :
29
+ ActionAgreementBelow P r A k h a := by
30
+ obtain ⟨a', ha, c, hc, base, hb, s, hs, F, hF, label, hl,
31
+ c', _, base', _, s', _, F', _, old, new, target, _, baseEq, _⟩ := transport
32
+ have aEq : a = a' :=
33
+ ((literalTaskFieldGraph_entry_iff ha hc hb hs hF hl 0).1 (old ▸ source)).2
34
+ have oldRestriction := (old ▸ first).restriction
35
+ have newRestriction := (new ▸ second).restriction
36
+ have composed := oldRestriction.transport action hg hδ hk product target
37
+ rw [baseEq] at newRestriction
38
+ intro x hx y _ lower
39
+ exact (composed.base_action_iff action hx (aEq ▸ lower)).symm.trans
40
+ (newRestriction.base_action_iff action hx (aEq ▸ lower))
41
+
42
+ namespace TransitiveGround
43
+
44
+ open SetFormula
45
+ variable (M : TransitiveGround.{u})
46
+
47
+ theorem groundTaskRepresentatives_product_agreement
48
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
49
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
50
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
51
+ {P G r μ A Labels m inv one Reps δ i j g h k a : ZFSet.{u}}
52
+ (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets)
53
+ (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A)
54
+ (meet : MeetOrderCode P r μ)
55
+ (reps : ZFSet.IsFunc (M.groundEligibleTasks P G r μ A Labels) G Reps)
56
+ (represents : ∀ i g, ZFSet.pair i g ∈ Reps →
57
+ TaskRepresentative P r A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels i g)
58
+ (task : ZFSet.pair (ZFSet.pair δ i) j ∈ M.groundTaskTransport P G r μ A Labels)
59
+ (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels)
60
+ P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels)
61
+ (first : ZFSet.pair i g ∈ Reps) (second : ZFSet.pair j h ∈ Reps)
62
+ (product : ZFSet.pair (ZFSet.pair δ g) k ∈ m) :
63
+ let d := M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet
64
+ ActionAgreementBelow d.batchCarrier d.batchOrder
65
+ (M.groundEligibleBatchAction P G r μ A Labels) k h a := by
66
+ have transported := (triple_mem_taskTransportGraph G _ P _ _ Labels A δ i j).1 task
67
+ have hg := (ZFSet.pair_mem_prod.1 (reps.1 first)).2
68
+ have hh := (ZFSet.pair_mem_prod.1 (reps.1 second)).2
69
+ have hk := (ZFSet.pair_mem_prod.1 (group.mul_function.1 product)).2
70
+ have old := transported.2.2.2.representative_product_agreement action transported.1 hg hk
71
+ product (represents i g first) (represents j h second) source
72
+ exact M.groundEligibleBatchAction_agreement pairing unions powers separation hP hG hA
73
+ group action meet hk hh ((represents i g first).source_mem source) old
74
+
75
+ theorem groundTaskRepresentatives_composed_entry
76
+ (pairing : Realize M.sets SetFormula.pairing Fin.elim0)
77
+ (unions : Realize M.sets SetFormula.union Fin.elim0)
78
+ (powers : Realize M.sets powerSet Fin.elim0) (separation : SeparationSchema M.sets)
79
+ {P G r μ A Labels m inv one Reps δ i j g h a x y z : ZFSet.{u}}
80
+ (hP : P ∈ M.sets) (hG : G ∈ M.sets) (hA : A ∈ M.sets)
81
+ (group : GroupCode G m inv one) (action : PosetActionCode G P m one r A)
82
+ (meet : MeetOrderCode P r μ)
83
+ (reps : ZFSet.IsFunc (M.groundEligibleTasks P G r μ A Labels) G Reps)
84
+ (represents : ∀ i g, ZFSet.pair i g ∈ Reps →
85
+ TaskRepresentative P r A (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels i g)
86
+ (task : ZFSet.pair (ZFSet.pair δ i) j ∈ M.groundTaskTransport P G r μ A Labels)
87
+ (source : ZFSet.pair i a ∈ literalTaskSourceGraph (M.groundEligibleTasks P G r μ A Labels)
88
+ P (M.groundRelations P P) (M.groundMeetFilters P r μ) Labels)
89
+ (first : ZFSet.pair i g ∈ Reps) (second : ZFSet.pair j h ∈ Reps)
90
+ (hx : x ∈ (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batchCarrier)
91
+ (lower : ZFSet.pair x a ∈
92
+ (M.groundEligibleTaskBatchInputs (Labels := Labels) group action meet).batchOrder)
93
+ (firstAction : ZFSet.pair (ZFSet.pair g x) y ∈ M.groundEligibleBatchAction P G r μ A Labels)
94
+ (secondAction : ZFSet.pair (ZFSet.pair h x) z ∈ M.groundEligibleBatchAction P G r μ A Labels) :
95
+ ZFSet.pair (ZFSet.pair δ y) z ∈ M.groundEligibleBatchAction P G r μ A Labels := by
96
+ have transported := (triple_mem_taskTransportGraph G _ P _ _ Labels A δ i j).1 task
97
+ have hg := (ZFSet.pair_mem_prod.1 (reps.1 first)).2
98
+ have hh := (ZFSet.pair_mem_prod.1 (reps.1 second)).2
99
+ obtain ⟨k, product, _⟩ := group.mul_function.2 (ZFSet.pair δ g)
100
+ (ZFSet.pair_mem_prod.2 ⟨transported.1, hg⟩)
101
+ have hk := (ZFSet.pair_mem_prod.1 (group.mul_function.1 product)).2
102
+ have agree := M.groundTaskRepresentatives_product_agreement pairing unions powers separation
103
+ hP hG hA group action meet reps represents task source first second product
104
+ have full := M.groundEligibleBatchAction_code (Labels := Labels)
105
+ pairing unions powers separation hP hG hA group action meet
106
+ have hy := (ZFSet.pair_mem_prod.1 (full.function.1 firstAction)).2
107
+ obtain ⟨w, acted, _⟩ := full.function.2 (ZFSet.pair δ y)
108
+ (ZFSet.pair_mem_prod.2 ⟨transported.1, hy⟩)
109
+ have hw := (ZFSet.pair_mem_prod.1 (full.function.1 acted)).2
110
+ have composed := full.mul δ transported.1 g hg k hk x hx y hy w hw product firstAction acted
111
+ have equal := agree.entry_eq full hh hx lower composed secondAction
112
+ exact equal ▸ acted
113
+
114
+ end TransitiveGround
115
+
116
+ end PartitionPilot.Forcing
117
+
118
+ end
119
+
120
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/RootedSupportOwnerFunction.lean CHANGED
@@ -1,59 +1,59 @@
1
- import OAI.SetTheory.PartitionPrinciple.Geometry.RootedSupportOrder
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme
8
-
9
- universe u
10
- variable {V : Type u} (d : Scheme V)
11
-
12
- noncomputable def owner (x : d.Node) : V :=
13
- Classical.choose (d.existsUnique_leastSupport x)
14
-
15
- theorem owner_least (x : d.Node) : d.LeastSupport (d.owner x) x :=
16
- (Classical.choose_spec (d.existsUnique_leastSupport x)).1
17
-
18
- theorem owner_eq_iff (x : d.Node) (v : V) :
19
- d.owner x = v ↔ d.LeastSupport v x := by
20
- constructor
21
- · intro eq
22
- rw [← eq]
23
- exact d.owner_least x
24
- · exact d.leastSupport_unique (d.owner_least x)
25
-
26
- theorem owner_depth_mono {x y : d.Node} (lower : d.gluedOrder.le x y) :
27
- d.depth (d.owner x) ≤ d.depth (d.owner y) :=
28
- d.leastSupport_depth_mono (d.owner_least x) (d.owner_least y) lower
29
-
30
- theorem owner_eq_of_depth_eq {x y : d.Node} (lower : d.gluedOrder.le x y)
31
- (same : d.depth (d.owner x) = d.depth (d.owner y)) : d.owner x = d.owner y :=
32
- d.leastSupport_eq_of_depth_eq (d.owner_least x) (d.owner_least y) lower same
33
-
34
- theorem owner_root_iff (x : d.Node) : d.owner x = d.root ↔ d.Supports d.root x :=
35
- (d.owner_eq_iff x d.root).trans (d.leastSupport_root_iff x)
36
-
37
- noncomputable def ownerCoordinate (x : d.Node) : d.Space (d.owner x) :=
38
- Classical.choose (d.owner_least x).1
39
-
40
- theorem ownerCoordinate_entry (x : d.Node) :
41
- (d.vertex (d.owner x)).toFun (d.ownerCoordinate x) = x :=
42
- Classical.choose_spec (d.owner_least x).1
43
-
44
- theorem ownerCoordinate_unique (x : d.Node) (a : d.Space (d.owner x))
45
- (entry : (d.vertex (d.owner x)).toFun a = x) : a = d.ownerCoordinate x :=
46
- embedding_injective (d.vertex (d.owner x)).toMeetEmbedding
47
- (entry.trans (d.ownerCoordinate_entry x).symm)
48
-
49
- theorem ownerCoordinate_fresh (x : d.Node) (nonroot : d.depth (d.owner x) ≠ 0) :
50
- ¬ (d.order (d.owner x)).le (d.ownerCoordinate x) (d.childAnchor (d.owner x) nonroot) := by
51
- apply (d.leastSupport_vertex_iff (d.owner x) nonroot (d.ownerCoordinate x)).mp
52
- rw [d.ownerCoordinate_entry]
53
- exact d.owner_least x
54
-
55
- end PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme
56
-
57
- end
58
-
59
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Geometry.RootedSupportOrder
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme
8
+
9
+ universe u
10
+ variable {V : Type u} (d : Scheme V)
11
+
12
+ noncomputable def owner (x : d.Node) : V :=
13
+ Classical.choose (d.existsUnique_leastSupport x)
14
+
15
+ theorem owner_least (x : d.Node) : d.LeastSupport (d.owner x) x :=
16
+ (Classical.choose_spec (d.existsUnique_leastSupport x)).1
17
+
18
+ theorem owner_eq_iff (x : d.Node) (v : V) :
19
+ d.owner x = v ↔ d.LeastSupport v x := by
20
+ constructor
21
+ · intro eq
22
+ rw [← eq]
23
+ exact d.owner_least x
24
+ · exact d.leastSupport_unique (d.owner_least x)
25
+
26
+ theorem owner_depth_mono {x y : d.Node} (lower : d.gluedOrder.le x y) :
27
+ d.depth (d.owner x) ≤ d.depth (d.owner y) :=
28
+ d.leastSupport_depth_mono (d.owner_least x) (d.owner_least y) lower
29
+
30
+ theorem owner_eq_of_depth_eq {x y : d.Node} (lower : d.gluedOrder.le x y)
31
+ (same : d.depth (d.owner x) = d.depth (d.owner y)) : d.owner x = d.owner y :=
32
+ d.leastSupport_eq_of_depth_eq (d.owner_least x) (d.owner_least y) lower same
33
+
34
+ theorem owner_root_iff (x : d.Node) : d.owner x = d.root ↔ d.Supports d.root x :=
35
+ (d.owner_eq_iff x d.root).trans (d.leastSupport_root_iff x)
36
+
37
+ noncomputable def ownerCoordinate (x : d.Node) : d.Space (d.owner x) :=
38
+ Classical.choose (d.owner_least x).1
39
+
40
+ theorem ownerCoordinate_entry (x : d.Node) :
41
+ (d.vertex (d.owner x)).toFun (d.ownerCoordinate x) = x :=
42
+ Classical.choose_spec (d.owner_least x).1
43
+
44
+ theorem ownerCoordinate_unique (x : d.Node) (a : d.Space (d.owner x))
45
+ (entry : (d.vertex (d.owner x)).toFun a = x) : a = d.ownerCoordinate x :=
46
+ embedding_injective (d.vertex (d.owner x)).toMeetEmbedding
47
+ (entry.trans (d.ownerCoordinate_entry x).symm)
48
+
49
+ theorem ownerCoordinate_fresh (x : d.Node) (nonroot : d.depth (d.owner x) ≠ 0) :
50
+ ¬ (d.order (d.owner x)).le (d.ownerCoordinate x) (d.childAnchor (d.owner x) nonroot) := by
51
+ apply (d.leastSupport_vertex_iff (d.owner x) nonroot (d.ownerCoordinate x)).mp
52
+ rw [d.ownerCoordinate_entry]
53
+ exact d.owner_least x
54
+
55
+ end PartitionPilot.Compression.RecursiveMaps.RootedGluing.Scheme
56
+
57
+ end
58
+
59
+ end OAI
lean/OAI/SetTheory/PartitionPrinciple/Definability/RowAssignmentCutGraphLaws.lean CHANGED
@@ -1,87 +1,87 @@
1
- import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRowAssignmentCuts
2
-
3
- namespace OAI
4
-
5
- section
6
-
7
- namespace PartitionPilot.Forcing
8
- universe u
9
-
10
- theorem rowAssignmentCutGraph_function (upper lower levels alpha : ZFSet.{u})
11
- (flat : ∀ p ∈ upper, ∃ row A, p = ZFSet.pair row A)
12
- (closed : ∀ row A, ZFSet.pair row A ∈ upper →
13
- ZFSet.pair row (assignmentCut levels alpha A) ∈ lower) :
14
- ZFSet.IsFunc upper lower (rowAssignmentCutGraph upper lower levels alpha) := by
15
- refine ⟨fun _ h => ((mem_rowAssignmentCutGraph _ _ _ _ _).1 h).1, ?_⟩
16
- intro p hp
17
- obtain ⟨row, A, rfl⟩ := flat p hp
18
- refine ⟨ZFSet.pair row (assignmentCut levels alpha A),
19
- (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 ⟨hp, closed row A hp, rfl⟩, ?_⟩
20
- intro q entry
21
- exact ((pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).1 entry).2.2
22
-
23
- theorem rowAssignmentCutGraph_compose
24
- (upper middle lower outerLevels beta innerLevels alpha directLevels gamma : ZFSet.{u})
25
- (middle_valid : ∀ row A, ZFSet.pair row A ∈ upper →
26
- ZFSet.pair row (assignmentCut outerLevels beta A) ∈ middle)
27
- (coherent : ∀ row A, ZFSet.pair row A ∈ upper →
28
- assignmentCut innerLevels alpha (assignmentCut outerLevels beta A) =
29
- assignmentCut directLevels gamma A) :
30
- relationCompose upper middle lower
31
- (rowAssignmentCutGraph upper middle outerLevels beta)
32
- (rowAssignmentCutGraph middle lower innerLevels alpha) =
33
- rowAssignmentCutGraph upper lower directLevels gamma := by
34
- apply ZFSet.ext
35
- intro z
36
- constructor
37
- · intro hz
38
- obtain ⟨p, hp, q, _, w, hw, rfl, first, second⟩ := (mem_relationCompose _ _ _ _ _ z).1 hz
39
- obtain ⟨_, row, A, equal⟩ := (mem_rowAssignmentCutGraph _ _ _ _ _).1 first
40
- obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
41
- have value := ((pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).1 second).2.2
42
- rw [coherent row A hp] at value
43
- exact (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 ⟨hp, hw, value⟩
44
- · intro hz
45
- obtain ⟨bound, row, A, rfl⟩ := (mem_rowAssignmentCutGraph _ _ _ _ z).1 hz
46
- obtain ⟨hp, hw⟩ := ZFSet.pair_mem_prod.1 bound
47
- have hm := middle_valid row A hp
48
- exact (mem_relationCompose _ _ _ _ _ _).2
49
- ⟨ZFSet.pair row A, hp, ZFSet.pair row (assignmentCut outerLevels beta A), hm,
50
- ZFSet.pair row (assignmentCut directLevels gamma A), hw, rfl,
51
- (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 ⟨hp, hm, rfl⟩,
52
- (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2
53
- ⟨hm, hw, congrArg (ZFSet.pair row) (coherent row A hp).symm⟩⟩
54
-
55
- theorem rowAssignmentCutGraph_nested (upper middle lower levels alpha beta : ZFSet.{u})
56
- (below : alpha ⊆ beta)
57
- (middle_valid : ∀ row A, ZFSet.pair row A ∈ upper →
58
- ZFSet.pair row (assignmentCut levels beta A) ∈ middle) :
59
- relationCompose upper middle lower (rowAssignmentCutGraph upper middle levels beta)
60
- (rowAssignmentCutGraph middle lower levels alpha) =
61
- rowAssignmentCutGraph upper lower levels alpha :=
62
- rowAssignmentCutGraph_compose upper middle lower levels beta levels alpha levels alpha
63
- middle_valid (fun _ _ _ => assignmentCut_nested below)
64
-
65
- theorem rowAssignmentCutGraph_identity (carrier levels alpha : ZFSet.{u})
66
- (flat : ∀ p ∈ carrier, ∃ row A, p = ZFSet.pair row A)
67
- (fixed : ∀ row A, ZFSet.pair row A ∈ carrier → assignmentCut levels alpha A = A) :
68
- rowAssignmentCutGraph carrier carrier levels alpha = identityFunctionGraph carrier := by
69
- apply ZFSet.ext
70
- intro z
71
- constructor
72
- · intro hz
73
- obtain ⟨bound, row, A, rfl⟩ := (mem_rowAssignmentCutGraph _ _ _ _ z).1 hz
74
- have hp := (ZFSet.pair_mem_prod.1 bound).1
75
- rw [fixed row A hp]
76
- exact (mem_identityFunctionGraph _ _).2 ⟨ZFSet.pair row A, hp, rfl⟩
77
- · intro hz
78
- obtain ⟨p, hp, rfl⟩ := (mem_identityFunctionGraph _ _).1 hz
79
- obtain ⟨row, A, rfl⟩ := flat p hp
80
- exact (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2
81
- ⟨hp, hp, congrArg (ZFSet.pair row) (fixed row A hp).symm⟩
82
-
83
- end PartitionPilot.Forcing
84
-
85
- end
86
-
87
- end OAI
 
1
+ import OAI.SetTheory.PartitionPrinciple.Geometry.GroundRowAssignmentCuts
2
+
3
+ namespace OAI
4
+
5
+ section
6
+
7
+ namespace PartitionPilot.Forcing
8
+ universe u
9
+
10
+ theorem rowAssignmentCutGraph_function (upper lower levels alpha : ZFSet.{u})
11
+ (flat : ∀ p ∈ upper, ∃ row A, p = ZFSet.pair row A)
12
+ (closed : ∀ row A, ZFSet.pair row A ∈ upper →
13
+ ZFSet.pair row (assignmentCut levels alpha A) ∈ lower) :
14
+ ZFSet.IsFunc upper lower (rowAssignmentCutGraph upper lower levels alpha) := by
15
+ refine ⟨fun _ h => ((mem_rowAssignmentCutGraph _ _ _ _ _).1 h).1, ?_⟩
16
+ intro p hp
17
+ obtain ⟨row, A, rfl⟩ := flat p hp
18
+ refine ⟨ZFSet.pair row (assignmentCut levels alpha A),
19
+ (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 ⟨hp, closed row A hp, rfl⟩, ?_⟩
20
+ intro q entry
21
+ exact ((pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).1 entry).2.2
22
+
23
+ theorem rowAssignmentCutGraph_compose
24
+ (upper middle lower outerLevels beta innerLevels alpha directLevels gamma : ZFSet.{u})
25
+ (middle_valid : ∀ row A, ZFSet.pair row A ∈ upper →
26
+ ZFSet.pair row (assignmentCut outerLevels beta A) ∈ middle)
27
+ (coherent : ∀ row A, ZFSet.pair row A ∈ upper →
28
+ assignmentCut innerLevels alpha (assignmentCut outerLevels beta A) =
29
+ assignmentCut directLevels gamma A) :
30
+ relationCompose upper middle lower
31
+ (rowAssignmentCutGraph upper middle outerLevels beta)
32
+ (rowAssignmentCutGraph middle lower innerLevels alpha) =
33
+ rowAssignmentCutGraph upper lower directLevels gamma := by
34
+ apply ZFSet.ext
35
+ intro z
36
+ constructor
37
+ · intro hz
38
+ obtain ⟨p, hp, q, _, w, hw, rfl, first, second⟩ := (mem_relationCompose _ _ _ _ _ z).1 hz
39
+ obtain ⟨_, row, A, equal⟩ := (mem_rowAssignmentCutGraph _ _ _ _ _).1 first
40
+ obtain ⟨rfl, rfl⟩ := ZFSet.pair_inj.1 equal
41
+ have value := ((pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).1 second).2.2
42
+ rw [coherent row A hp] at value
43
+ exact (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 ⟨hp, hw, value⟩
44
+ · intro hz
45
+ obtain ⟨bound, row, A, rfl⟩ := (mem_rowAssignmentCutGraph _ _ _ _ z).1 hz
46
+ obtain ⟨hp, hw⟩ := ZFSet.pair_mem_prod.1 bound
47
+ have hm := middle_valid row A hp
48
+ exact (mem_relationCompose _ _ _ _ _ _).2
49
+ ⟨ZFSet.pair row A, hp, ZFSet.pair row (assignmentCut outerLevels beta A), hm,
50
+ ZFSet.pair row (assignmentCut directLevels gamma A), hw, rfl,
51
+ (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2 ⟨hp, hm, rfl⟩,
52
+ (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2
53
+ ⟨hm, hw, congrArg (ZFSet.pair row) (coherent row A hp).symm⟩⟩
54
+
55
+ theorem rowAssignmentCutGraph_nested (upper middle lower levels alpha beta : ZFSet.{u})
56
+ (below : alpha ⊆ beta)
57
+ (middle_valid : ∀ row A, ZFSet.pair row A ∈ upper →
58
+ ZFSet.pair row (assignmentCut levels beta A) ∈ middle) :
59
+ relationCompose upper middle lower (rowAssignmentCutGraph upper middle levels beta)
60
+ (rowAssignmentCutGraph middle lower levels alpha) =
61
+ rowAssignmentCutGraph upper lower levels alpha :=
62
+ rowAssignmentCutGraph_compose upper middle lower levels beta levels alpha levels alpha
63
+ middle_valid (fun _ _ _ => assignmentCut_nested below)
64
+
65
+ theorem rowAssignmentCutGraph_identity (carrier levels alpha : ZFSet.{u})
66
+ (flat : ∀ p ∈ carrier, ∃ row A, p = ZFSet.pair row A)
67
+ (fixed : ∀ row A, ZFSet.pair row A ∈ carrier → assignmentCut levels alpha A = A) :
68
+ rowAssignmentCutGraph carrier carrier levels alpha = identityFunctionGraph carrier := by
69
+ apply ZFSet.ext
70
+ intro z
71
+ constructor
72
+ · intro hz
73
+ obtain ⟨bound, row, A, rfl⟩ := (mem_rowAssignmentCutGraph _ _ _ _ z).1 hz
74
+ have hp := (ZFSet.pair_mem_prod.1 bound).1
75
+ rw [fixed row A hp]
76
+ exact (mem_identityFunctionGraph _ _).2 ⟨ZFSet.pair row A, hp, rfl⟩
77
+ · intro hz
78
+ obtain ⟨p, hp, rfl⟩ := (mem_identityFunctionGraph _ _).1 hz
79
+ obtain ⟨row, A, rfl⟩ := flat p hp
80
+ exact (pair_mem_rowAssignmentCutGraph _ _ _ _ _ _ _).2
81
+ ⟨hp, hp, congrArg (ZFSet.pair row) (fixed row A hp).symm⟩
82
+
83
+ end PartitionPilot.Forcing
84
+
85
+ end
86
+
87
+ end OAI